﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Kortex.Communication_objs;
using Kortex.WallMgr;
using Kortex.Common;
using Kortex.Container;
using System.Threading;

namespace Kortex.WallManagerSpce.CubeManager
{
    public partial class CubeGui : UserControl
    {
        WallManager mProducer = null;
        int Ident = 1;
        public CubeGui()
        {
            InitializeComponent();
        }

        public CubeGui(WallManager producer)
        {
            InitializeComponent();
            mProducer = producer;
        }

        private int getIdnet()
        {

            return Ident++;
        }

        public bool Gui
        {
            get
            {
                return Cube_level_Controls.Enabled;
            
            }
            set
            {
                Cube_level_Controls.Enabled = value;
            
            }
        
        }
        
        
        private void SetColorPickerPanelBgCOlor(string colr, int r, int g, int b)
        {
            switch (colr)
            {
                case "red":
                    Img_Color_picker_show_panel.BackColor = Color.Red;
                    break;
                case "green":
                    Img_Color_picker_show_panel.BackColor = Color.Green;
                    break;
                case "white":
                    Img_Color_picker_show_panel.BackColor = Color.White;
                    break;
                case "blue":
                    Img_Color_picker_show_panel.BackColor = Color.Blue;
                    break;
                case "cyan":
                    Img_Color_picker_show_panel.BackColor = Color.Cyan;
                    break;
                case "magenta":
                    Img_Color_picker_show_panel.BackColor = Color.Magenta;
                    break;

                case "yellow":
                    Img_Color_picker_show_panel.BackColor = Color.Yellow;
                    break;
                case "custom":
                    Color clr = Color.FromArgb(r, g, b);
                    Img_Color_picker_show_panel.BackColor = clr;
                    break;
            }



        }

        private void SetColorPickerPanelBgCOlor(string colr, string r, string g, string b)
        {
            switch (colr)
            {
                case "red":
                    Img_Color_picker_show_panel.BackColor = Color.Red;
                    break;
                case "green":
                    Img_Color_picker_show_panel.BackColor = Color.Green;
                    break;
                case "white":
                    Img_Color_picker_show_panel.BackColor = Color.White;
                    break;
                case "blue":
                    Img_Color_picker_show_panel.BackColor = Color.Blue;
                    break;
                case "cyan":
                    Img_Color_picker_show_panel.BackColor = Color.Cyan;
                    break;
                case "magenta":
                    Img_Color_picker_show_panel.BackColor = Color.Magenta;
                    break;

                case "yellow":
                    Img_Color_picker_show_panel.BackColor = Color.Yellow;
                    break;
                case "custom":
                    int red = Convert.ToInt32(r);
                    int green = Convert.ToInt32(g);
                    int blue = Convert.ToInt32(b);

                    Color clr = Color.FromArgb(red, green, blue);
                    Img_Color_picker_show_panel.BackColor = clr;
                    break;
            }



        }

        private void GetSaveAllResult(Cube_command_reqObj req, General_responce res, string rpcID)
        {
            
            if (rpcID != null)
                req.rpcPollId = rpcID;

            if (res.result.taskStatus != null)
                if (res.result.taskStatus.ToLower() == "success")
                {
                    DB_saveAll_result_show.Text = res.result.taskStatus;
                    DB_saveAll_result_show.BackColor = Color.GreenYellow;
                    mProducer.StopAnimetion(req.mCol, req.mRow);
                    
                    return;
                }


            if (res.result.taskStatus != null)
                if (res.result.taskStatus.ToLower() == "taskidnotfound" || res.result.taskStatus.ToLower() == "fail")
                {
                    DB_saveAll_result_show.Text = res.result.taskStatus;
                    DB_saveAll_result_show.BackColor = Color.Red;
                    mProducer.StopAnimetion(req.mCol, req.mRow);
                    return;
                }

            Thread.Sleep(100);

            
            string[] parm = new string[1];
            parm[0] = req.rpcPollId;
            Cube_command_reqObj obj = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 10001, req.mCol, req.mRow, commandType.cmd_rpc_status_get, parm, DB_saveAll_result_show, null);
            obj.rpcPollId = req.rpcPollId; // because now this time i will get this object as requested object
            mProducer.GetRpcStatus(obj, "Get RPC starus");

        }

        private void GetGamaUpdateResult(Cube_command_reqObj req, General_responce res, string rpcID)
        {

            if (rpcID != null)
                req.rpcPollId = rpcID;

            if (res.result.taskStatus != null)
                if (res.result.taskStatus.ToLower() == "success")
                {
                    textBox182.Text = res.result.taskStatus;
                    textBox182.BackColor = Color.GreenYellow;
                    mProducer.StopAnimetion(req.mCol, req.mRow);
                    return;
                }

            if (res.result.taskStatus != null)
                if (res.result.taskStatus.ToLower() == "taskidnotfound" || res.result.taskStatus.ToLower() == "fail")
                {
                    textBox182.Text = res.result.taskStatus;
                    textBox182.BackColor = Color.Red;
                    mProducer.StopAnimetion(req.mCol, req.mRow);
                    return;
                }

            

            textBox182.BackColor = Color.Pink;
            if (res.result.taskStatus != null)
                textBox182.Text = res.result.taskStatus;

            //Thread.Sleep(6000);
            Delay(2000);

            if (rpcID != null)
            {
                string[] parm = new string[1];
                parm[0] = req.rpcPollId;
                Cube_command_reqObj obj = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 10001, req.mCol, req.mRow, commandType.cmd_cs_barco_gama_set_update_status, parm, textBox182, null);
                obj.rpcPollId = req.rpcPollId; // because now this time i will get this object as requested object
                mProducer.GetRpcStatus(obj, "Get RPC starus");
            }
            else
                mProducer.GetRpcStatus(req, "Get RPC starus");

        }


        # region delay

        void Delay(int ms)
        {
            int time = Environment.TickCount;

            while (true)
                if (Environment.TickCount - time >= ms) return;

        }


        #endregion      

        private void GetLogFile(Cube_command_reqObj req, General_responce res)
        {
            if (res.result.count != null)
            {
                req.MsgCount = Convert.ToInt32(res.result.count);
                req.linenum = 0;
            }

            textBox174.BackColor = Color.HotPink;
            Cube_command_reqObj obj =null;
           // GuiBoxArray gui = null;
            //gui.Add(textBox155, textBox154, textBox153);
            if (req.linenum == 0)
            {
                obj = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 10001, req.mCol, req.mRow, commandType.cmd_mo_get_log_msg_internal, null, textBox177, null);
                obj.linenum = (req.linenum + 1);
                mProducer.GetRpcStatus(obj, "Get Log Message");
            }
            else
            {
                req.linenum = (req.linenum + 1);
                mProducer.GetRpcStatus(req, "Get Log Message");
            }
            
        }

        private void GetDiagnostics_count(Cube_command_reqObj req, General_responce res)
        {
            Cube_command_reqObj obj = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 10001, req.mCol, req.mRow, commandType.cmd_mo_Get_Diagnostics_count_get, null, textBox177, null);
            mProducer.GetRpcStatus(obj, "Get Dignosis Count");
        }


        private void GetLogFileOf_diagnostics(Cube_command_reqObj req, General_responce res)
        {
            if (res.result.count != null)
            {
                req.MsgCount = Convert.ToInt32(res.result.count);
                req.linenum = 0;
            }

            textBox177.BackColor = Color.HotPink;
            Cube_command_reqObj obj = null;
            // GuiBoxArray gui = null;
            //gui.Add(textBox155, textBox154, textBox153);
            if (req.linenum == 0)
            {
                string[] param = new string[1];
                param[0] = "1";

                obj = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 10001, req.mCol, req.mRow, commandType.cmd_mo_Get_Diagnostics_msgs_get, param, textBox177, null);
                obj.linenum = (req.linenum + 1);
                mProducer.GetRpcStatus(obj, "Get Diagnosis Message");
            }
            else
            {
                req.linenum = (req.linenum + 1);
                req.args[0] = req.linenum.ToString();
                mProducer.GetRpcStatus(req, "Get Diagnosis Message");
            }

        }

        private void GettiggerDiagnosticsResult(Cube_command_reqObj req, General_responce res, string rpcID)
        {

            if (rpcID != null)
                req.rpcPollId = rpcID;

            if (res.result.taskStatus != null)
                if (res.result.taskStatus.ToLower() == "success")
                {
                    GetDiagnostics_count(req,res);
                    return;
                }


            if (res.result.taskStatus != null)
                if (res.result.taskStatus.ToLower() == "taskidnotfound" || res.result.taskStatus.ToLower() == "fail")
                {
                    
                    textBox177.BackColor = Color.Red;
                    mProducer.StopAnimetion(req.mCol, req.mRow);
                    return;
                }
            

            Delay(7500);

            textBox177.Text = res.result.taskStatus;
            textBox177.BackColor = Color.HotPink;

            Delay(7500);

            string[] parm = new string[1];
            parm[0] = req.rpcPollId;
            Cube_command_reqObj obj = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 10001, req.mCol, req.mRow, commandType.cmd_mo_tigger_Diagnostics_status_get, parm, textBox177, null);
            obj.rpcPollId = req.rpcPollId; // because now this time i will get this object as requested object
            mProducer.GetRpcStatus(obj, "Get RPC starus");

        }

        private void Handle_responce(Cube_command_reqObj req, General_responce res)
        {
            switch (req.cmdType)
            {

                case commandType.cmd_mo_Get_Diagnostics_msgs_get:
                    if (res.result.message != null)
                    {
                        // Delay(100);
                        GetLogFileOf_diagnostics(req, res);
                        MO_DiagnosticsMessages_richBox.AppendText(req.mIp +"=>" +res.result.message);
                    }
                    else
                        mProducer.StopAnimetion(req.mCol, req.mRow);
                    break;
                case commandType.cmd_mo_Get_Diagnostics_count_get:
                    // Delay(100);
                    if (res.result.count != null)
                        GetLogFileOf_diagnostics(req, res);

                    break;
                case commandType.cmd_mo_tigger_Diagnostics_status_get:
                case commandType.cmd_mo_tigger_Diagnostics:
                    //Delay(200);

                    GettiggerDiagnosticsResult(req, res, res.result.taskId);

                    break;

                case commandType.cmd_mo_get_log_msg_internal:
                    if (res.result.message != null)
                    {
                        GetLogFile(req, res);
                        MO_LogMessages_richBox.AppendText(req.mIp + " " + req.mSerialNum+ " " + res.result.message);
                    }
                    else
                        mProducer.StopAnimetion(req.mCol, req.mRow);

                    break;

                case commandType.cmd_mo_get_log_msg_count_internal:
                    //Delay(100);
                    if (res.result.count != null)
                        GetLogFile(req, res);
                    else
                        mProducer.StopAnimetion(req.mCol, req.mRow);
                    break;
                case commandType.cmd_mo_get_fan_ticks:
                    if (res.result.ticks != null)
                        req.guiVal.TextBoxs[0].Text = res.result.ticks;

                    break;
                case commandType.cmd_cs_gaam_upload_status_get:
                    if (res.result.status != null)
                        req.guiVal.TextBoxs[0].Text = res.result.status;
                    
                    break;

                case commandType.cmd_cs_barco_gama_set:
                case commandType.cmd_cs_barco_gama_set_update_status:
                    GetGamaUpdateResult(req, res, res.result.taskId);
                    break;
                case commandType.cmd_img_pattern_type_get:

                    if (res.result.pattern != null)
                        req.guiVal.ComboBoxs[0].Text = res.result.pattern;

                    break;
                case commandType.cmd_cs_Calibrated_XYZ_get:
                    req.guiVal.TextBoxs[0].Text = res.result.X.ToString();
                    req.guiVal.TextBoxs[1].Text = res.result.Y.ToString();
                    req.guiVal.TextBoxs[2].Text = res.result.Z.ToString();

                    break;
                case commandType.cmd_cs_int_field_ref_data_get:
                case commandType.cmd_cs_int_factory_ref_data_get:

                    req.guiVal.TextBoxs[0].Text = res.result.red_0.ToString();
                    req.guiVal.TextBoxs[1].Text = res.result.green_0.ToString();
                    req.guiVal.TextBoxs[2].Text = res.result.blue_0.ToString();
                    req.guiVal.TextBoxs[3].Text = res.result.red_1.ToString();
                    req.guiVal.TextBoxs[4].Text = res.result.green_1.ToString();
                    req.guiVal.TextBoxs[5].Text = res.result.blue_1.ToString();

                    break;

                case commandType.cmd_cs_ext_field_ref_data_get:
                case commandType.cmd_cs_ext_factory_ref_data_get:


                    if (res.result.timestamp != null)
                        req.guiVal.TextBoxs[0].Text = res.result.timestamp;
                    if (res.result.proddata != null)
                        req.guiVal.TextBoxs[1].Text = res.result.proddata;
                    if (res.result.processVer != null)
                        req.guiVal.TextBoxs[2].Text = res.result.processVer;

                    req.guiVal.TextBoxs[3].Text = res.result.red_X.ToString();
                    req.guiVal.TextBoxs[4].Text = res.result.red_Y.ToString();
                    req.guiVal.TextBoxs[5].Text = res.result.red_Z.ToString();
                    req.guiVal.TextBoxs[6].Text = res.result.green_X.ToString();
                    req.guiVal.TextBoxs[7].Text = res.result.green_Y.ToString();
                    req.guiVal.TextBoxs[8].Text = res.result.green_Z.ToString();
                    req.guiVal.TextBoxs[9].Text = res.result.blue_X.ToString();
                    req.guiVal.TextBoxs[10].Text = res.result.blue_Y.ToString();
                    req.guiVal.TextBoxs[11].Text = res.result.blue_Z.ToString();

                    break;

                case commandType.cmd_cs_field_calib_get:
                case commandType.cmd_cs_factory_calib_get:

                    req.guiVal.TextBoxs[0].Text = res.result.red_X.ToString();
                    req.guiVal.TextBoxs[1].Text = res.result.red_Y.ToString();
                    req.guiVal.TextBoxs[2].Text = res.result.red_Z.ToString();
                    req.guiVal.TextBoxs[3].Text = res.result.green_X.ToString();
                    req.guiVal.TextBoxs[4].Text = res.result.green_Y.ToString();
                    req.guiVal.TextBoxs[5].Text = res.result.green_Z.ToString();
                    req.guiVal.TextBoxs[6].Text = res.result.blue_X.ToString();
                    req.guiVal.TextBoxs[7].Text = res.result.blue_Y.ToString();
                    req.guiVal.TextBoxs[8].Text = res.result.blue_Z.ToString();

                    break;

                case commandType.cmd_cs_max_min_brightness_get:
                    req.guiVal.TextBoxs[0].Text = res.result.min_brightness.ToString();
                    req.guiVal.TextBoxs[1].Text = res.result.max_brightness.ToString();
                    break;

                case commandType.cmd_cs_gobal_error_info_get:
                    if (res.result.colorOutOfTolerance != null)
                        req.guiVal.TextBoxs[0].Text = res.result.colorOutOfTolerance;
                    if (res.result.colorNotReachable != null)
                        req.guiVal.TextBoxs[1].Text = res.result.colorNotReachable;
                    if (res.result.brightnessNotReachable != null)
                        req.guiVal.TextBoxs[2].Text = res.result.brightnessNotReachable;
                    if (res.result.spectralCalibMissing != null)
                        req.guiVal.TextBoxs[3].Text = res.result.spectralCalibMissing;
                    if (res.result.sensorState != null)
                        req.guiVal.TextBoxs[4].Text = res.result.sensorState;


                    break;
                case commandType.cmd_cs_cbm_mode_params_get:
                    req.guiVal.TextBoxs[0].Text = res.result.backlight.ToString();
                    req.guiVal.TextBoxs[1].Text = res.result.rOffset.ToString();
                    req.guiVal.TextBoxs[2].Text = res.result.gOffset.ToString();
                    req.guiVal.TextBoxs[3].Text = res.result.bOffset.ToString();
                    req.guiVal.TextBoxs[4].Text = res.result.rGain.ToString();
                    req.guiVal.TextBoxs[5].Text = res.result.gGain.ToString();
                    req.guiVal.TextBoxs[6].Text = res.result.bGain.ToString();
                    break;
                case commandType.cmd_cs_black_level_get:
                case commandType.cmd_cs_white_level_get:

                    if (res.result.value != null)
                        req.guiVal.TextBoxs[0].Text = res.result.value;

                    break;
                

                case commandType.cmd_cs_white_banance_get:
                    req.guiVal.TextBoxs[0].Text = res.result.delta_x.ToString();
                    req.guiVal.TextBoxs[1].Text = res.result.delta_y.ToString();
                    req.guiVal.TextBoxs[2].Text = res.result.delta_Y.ToString();
                    break;

                case commandType.cmd_cs_cbm_mode_get:

                    if (res.result.mode != null)
                        req.guiVal.ComboBoxs[0].Text = res.result.mode;
                    break;
                case commandType.cmd_cs_user_target_control_params_get:
                    //opsCOntrolPanel1.StopBlink(1);
                    textBox158.Text = res.result.colortemp.ToString();
                    textBox157.Text = res.result.locusOffset.ToString();

                    if (res.result.gammaFactor != null)
                        cs_UTP_GaamaFacrot_Combo.Text = res.result.gammaFactor;

                    textBox152.Text = res.result.brightness.ToString();
                    textBox151.Text = res.result.target_x.ToString();
                    textBox150.Text = res.result.target_y.ToString();


                    break;
                case commandType.cmd_cs_params_get:
                    
                    req.guiVal.ComboBoxs[0].Text = res.result.gain.ToString();
                    req.guiVal.ComboBoxs[1].Text = res.result.prescale.ToString();

                    if (res.result.period != null)
                        req.guiVal.ComboBoxs[2].Text = res.result.period;
                    if (res.result.pulses != null)
                        req.guiVal.ComboBoxs[3].Text = res.result.pulses;

                    break;
                case commandType.cmd_cs_raw_mes_cis_get:
                case commandType.cmd_cs_backlight_mes_get:
                case commandType.cmd_cs_backlight_mes_update_get:
                case commandType.cmd_cs_raw_count_get:
                    //opsCOntrolPanel1.StopBlink(1);

                    if (res.result.cs_resp0 != null)
                        req.guiVal.TextBoxs[0].Text = res.result.cs_resp0;
                    if (res.result.cs_resp1 != null)
                        req.guiVal.TextBoxs[1].Text = res.result.cs_resp1;
                    if (res.result.red_0 != null)
                        req.guiVal.TextBoxs[2].Text = res.result.red_0;
                    if (res.result.green_0 != null)
                        req.guiVal.TextBoxs[3].Text = res.result.green_0;
                    if (res.result.blue_0 != null)
                        req.guiVal.TextBoxs[4].Text = res.result.blue_0;
                    if (res.result.white_0 != null)
                        req.guiVal.TextBoxs[5].Text = res.result.white_0;
                    if (res.result.red_1 != null)
                        req.guiVal.TextBoxs[6].Text = res.result.red_1;
                    if (res.result.green_1 != null)
                        req.guiVal.TextBoxs[7].Text = res.result.green_1;
                    if (res.result.blue_1 != null)
                        req.guiVal.TextBoxs[8].Text = res.result.blue_1;
                    if (res.result.white_1 != null)
                        req.guiVal.TextBoxs[9].Text = res.result.white_1;



                    break;
                case commandType.cmd_net_NetInfo_get:
                    //opsCOntrolPanel1.StopBlink(1);

                    if (res.result.mac != null)
                        req.guiVal.TextBoxs[0].Text = res.result.mac;

                    if (res.result.ip != null)
                        req.guiVal.TextBoxs[1].Text = res.result.ip;

                    if (res.result.netmask != null)
                        req.guiVal.TextBoxs[2].Text = res.result.netmask;

                    break;

                case commandType.cmd_ops_power_state_get:
                    //opsCOntrolPanel1.StopBlink(1);

                    if (res.result.state != null)
                        opsCOntrolPanel1.SetToolTipTitle(res.result.state, 1);

                    if (res.result.state == "off")
                        opsCOntrolPanel1.SetColor(Color.Gray, 1);
                    else
                        opsCOntrolPanel1.SetColor(Color.GreenYellow, 1);

                    break;
                case commandType.cmd_ops_fan_state_get:
                    // opsCOntrolPanel1.StopBlink(2);

                    if (res.result.state != null)
                        opsCOntrolPanel1.SetToolTipTitle(res.result.state, 2);
                    if (res.result.state == "off")
                        opsCOntrolPanel1.SetColor(Color.Gray, 2);
                    else
                        opsCOntrolPanel1.SetColor(Color.GreenYellow, 2);

                    break;

                case commandType.cmd_ops_plug_state_get:
                    // opsCOntrolPanel1.StopBlink(3);

                    if (res.result.state != null)
                        opsCOntrolPanel1.SetToolTipTitle(res.result.state, 3);

                    if (res.result.state.ToLower() == "unplugged")
                        opsCOntrolPanel1.SetColor(Color.Gray, 3);
                    else
                        opsCOntrolPanel1.SetColor(Color.GreenYellow, 3);

                    break;
                case commandType.cmd_ops_operationt_get:
                    if (req.guiVal.ComboBoxs != null)
                        if (res.result.state != null)
                            req.guiVal.ComboBoxs[0].Text = res.result.state;
                    break;
                case commandType.cmd_dataBase_saveAll:
                        GetSaveAllResult(req, res, res.result.taskId);
                    break;
                case commandType.cmd_rpc_status_get:
                    GetSaveAllResult(req, res, null);
                    break;
                case commandType.cmd_mo_loadinfo_get:
                    if (res.result.current != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.current;

                    if (res.result.average != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[1].Text = res.result.average;

                    if (res.result.uptimeSec != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[2].Text = res.result.uptimeSec;

                    break;
                case commandType.cmd_net_networkIf_get:
                    //opsCOntrolPanel1.StopBlink(1);

                    if (res.result.ip != null)
                        req.guiVal.TextBoxs[0].Text = res.result.ip;

                    if (res.result.netmask != null)
                        req.guiVal.TextBoxs[1].Text = res.result.netmask;

                    if (res.result.addressing != null)
                        Net_GetSetNetIf_Mode_combo.Text = res.result.addressing;

                    break;
                case commandType.cmd_AutoSave_state_get:
                    if (res.result.status != null)
                        if (req.guiVal.ComboBoxs != null)
                            req.guiVal.ComboBoxs[0].Text = res.result.status;
                    break;
                
                case commandType.cmd_mo_meminfo_get:
                    if (res.result.memMB != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.memMB;

                    if (res.result.memfreeMB != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[1].Text = res.result.memfreeMB;

                    if (res.result.memusedMB != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[2].Text = res.result.memusedMB;

                    break;
                case commandType.cmd_mo_runtimes_get:
                    
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.mercury.ToString();

                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[1].Text = res.result.smps.ToString();


                    if (res.result.backlight != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[2].Text = res.result.backlight.ToString();

                    break;

                case commandType.cmd_img_video_byPass_get:

                    if (req.guiVal.ComboBoxs != null)
                        if (res.result.cmd != null)
                            req.guiVal.ComboBoxs[0].Text = res.result.cmd;
                    break;
                
                case commandType.cmd_img_errors_get:
                    //opsCOntrolPanel1.StopBlink(1);

                    if (res.result.wallCfgerror != null)
                        req.guiVal.TextBoxs[0].Text = res.result.wallCfgerror;

                    if (res.result.bypass_error != null)
                        req.guiVal.TextBoxs[1].Text = res.result.bypass_error;
                    break;

                case commandType.cmd_img_input_timing_get:
                 if (req.guiVal.TextBoxs != null)
                    {
                        req.guiVal.TextBoxs[0].Text = res.result.h_active;
                        req.guiVal.TextBoxs[1].Text = res.result.v_active;
                        req.guiVal.TextBoxs[2].Text = res.result.frame_rate;
                        req.guiVal.TextBoxs[3].Text = res.result.pixel_clock;
                    }
                 break;
                case commandType.cmd_img_genlock_status_get:
                    if (res.result.status != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.status;
                    break;
                case commandType.cmd_bid_get:
                case commandType.cmd_bid_set:
                    if (res.result.@return.ToLower() == "success")
                    {
                        if (res.result.value != null)
                        {
                            req.guiVal.TextBoxs[0].Text = res.result.value;
                            req.guiVal.TextBoxs[0].BackColor = Color.LawnGreen;
                        }
                        else
                            req.guiVal.TextBoxs[0].BackColor = Color.GreenYellow;
                    }
                    else
                    {
                        req.guiVal.TextBoxs[0].Text = res.result.@return;
                        req.guiVal.TextBoxs[0].BackColor = Color.Red;
                    }
                    break;
                case commandType.cmd_fpga_reg_get:
                     if (res.result.data != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.data;
                    break;

                case commandType.cmd_fmw_mstar_version_get:
                    if (res.result.@string != null)
                        if (req.guiVal.TextBoxs != null)
                        {
                            req.guiVal.TextBoxs[0].Text = res.result.@string.ToString();
                            //mProducer.ShowMstarVersion(req.mCol, req.mRow, ("MS" + res.result.@string));
                        }
                    break;

                case commandType.cmd_mac_address_get:
                    if (res.result.macaddr != null)
                    {
                        if (res.result.macaddr.Contains("eth"))
                        {
                            string[] str = res.result.macaddr.Split('=');
                            if (req.guiVal.TextBoxs != null)
                                req.guiVal.TextBoxs[0].Text = str[1].Replace("\n", "");
                        }
                        else
                            req.guiVal.TextBoxs[0].Text = res.result.macaddr;
                    }
                    break;

                case commandType.cmd_module_version_get:
                    if (res.result.version != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.version;
                    break;
                case commandType.cmd_temprature_get:
                    if (res.result.value != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.value;
                    break;

                case commandType.cmd_mo_get_fan_speed:
                    if (res.result.speed != null)
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.speed;
                    break;
                case commandType.cmd_img_wallConfig_state_get:
                    if (req.guiVal.TextBoxs != null)
                    {
                        req.guiVal.TextBoxs[0].Text = res.result.state;
                        if (res.result.state == "on")
                            img_WallGeo_Enable_ON_radio.Checked = true;
                        else
                            img_WallGeo_Enable_Off_radio.Checked = true;
                    }

                    break;
                case commandType.cmd_img_background_get:
                     if (res.result.bkgnd == "custom")
                    {
                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[0].Text = res.result.red.ToString();


                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[1].Text = res.result.green.ToString();


                        if (req.guiVal.TextBoxs != null)
                            req.guiVal.TextBoxs[2].Text = res.result.blue.ToString();
                    }

                    img_background_combo.Text = res.result.bkgnd;
                    SetColorPickerPanelBgCOlor(res.result.bkgnd, res.result.red, res.result.green, res.result.blue);
                    break;

                case commandType.cmd_optical_dvi_get:
                    if (req.guiVal.ComboBoxs != null)
                        req.guiVal.ComboBoxs[0].Text = res.result.status;
                    break;

                case commandType.cmd_get_Active_input:
                    if (req.guiVal.TextBoxs != null)
                        req.guiVal.TextBoxs[0].Text = res.result.input;
                    break;
                
                case commandType.cmd_get_input_selected:
                    if (req.guiVal.ComboBoxs != null)
                        req.guiVal.ComboBoxs[0].Text = res.result.input;
                    break;
                case commandType.cmd_img_wallGeometry_get:
                    if (req.guiVal.TextBoxs != null)
                        req.guiVal.TextBoxs[0].Text = res.result.x.ToString();


                    if (req.guiVal.TextBoxs != null)
                        req.guiVal.TextBoxs[1].Text = res.result.y.ToString();


                    if (req.guiVal.TextBoxs != null)
                        req.guiVal.TextBoxs[2].Text = res.result.max_x.ToString();


                    if (req.guiVal.TextBoxs != null)
                        req.guiVal.TextBoxs[3].Text = res.result.max_y.ToString();

                    //img_WallGeoMetry_input.Text = res.result.input;
                    img_WallGeoMetry_Mode.Text = res.result.mode;

                    break;
                case commandType.cmd_pic_contrst_get:
                    txtboxControst_show.Text = res.result.value;
                    Pic_Contrast_Slider.Value = Convert.ToInt32(res.result.value);
                    break;
                case commandType.cmd_cs_backLight_get:
                    cs_back_light_show.Text = res.result.value;
                    CS_BackLight_slider.Value = Convert.ToInt32(res.result.value);
                    break;
                case commandType.cmd_pic_backlight_get:
                    txtboxBacklight_show.Text = res.result.value;
                    Pic_Backlight_Slider.Value = Convert.ToInt32(res.result.value);
                    break;
                case commandType.cmd_pic_red_offset_get:
                    if (res.result.value != null)
                    {
                        textBox211.Text = res.result.value;
                        Pic_Red_Offset_Slider.Value = Int32.Parse(res.result.value);
                    }
                    break;
                case commandType.cmd_pic_green_offset_get:
                    if (res.result.value != null)
                    {
                        textBox215.Text = res.result.value;
                        Pic_Green_Offset_Slider.Value = Int32.Parse(res.result.value);
                    }
                    break;
                case commandType.cmd_pic_blue_offset_get:
                    if (res.result.value != null)
                    {
                        textBox213.Text = res.result.value;
                        Pic_Blue_Offset_Slider.Value = Int32.Parse(res.result.value);
                    }
                    break;
                case commandType.cmd_pic_brightness_get:
                    txtbox_Brightness_show.Text = res.result.value;
                    Pic_Brightness_Slider.Value = Convert.ToInt32(res.result.value);
                    break;
                case commandType.cmd_pic_red_gain_get:
                    txtbox_redGain_show.Text = res.result.value;
                    Pic_Red_gain_Slider.Value = Convert.ToInt32(res.result.value);
                    break;
                case commandType.cmd_pic_green_gain_get:
                    txtbox_GreenGain_show.Text = res.result.value;
                    Pic_Green_gain_Slider.Value = Convert.ToInt32(res.result.value);
                    break;
                case commandType.cmd_pic_blue_gain_get:
                    txtbox_BlueGain_show.Text = res.result.value;
                    Pic_Blue_gain_Slider.Value = Convert.ToInt32(res.result.value);
                    break;



                //cmd_pic_red_gain_get
            }
        
        }

        public void CubeControllerResponce(Cube_command_reqObj req_obj, General_responce res)
        {
            

            if (req_obj != null)
            {
                if (req_obj.ReturnBox != null)
                {
                    if (res.error != null)
                    {
                        req_obj.ReturnBox.Text = res.error.message;
                        req_obj.ReturnBox.BackColor = Color.Red;

                    }
                    else
                    {
                        req_obj.ReturnBox.Text = res.result.@return;
                        req_obj.ReturnBox.BackColor = Color.LightGreen;
                        
                        if (res.result != null)
                        Handle_responce(req_obj, res);
                    }
                }

                
            }

        
        }

        #region Image tab comtrol
        private void Img_GetMercurySourceSelected_butt_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            Image_MercurySetSource_result_show.BackColor = Color.Pink;
            gui.Add(Image_MercurySourceList_combo);
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_get_input_selected, null, Image_MercurySetSource_result_show, gui);
            mProducer.CubeControlRequest(req,"Get Source");
        }

        private void Img_MercurySetSourceSelected_butt_Click(object sender, EventArgs e)
        {
            
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Image_MercurySourceList_combo);
            Image_MercurySetSource_result_show.BackColor = Color.Pink;
            
            string[] parm = new string[1];
            parm[0] = Image_MercurySourceList_combo.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_set_input_selected, parm, Image_MercurySetSource_result_show, gui);

            mProducer.CubeControlRequest(req,"Set Source");
           
        }

        private void Img_SetSOurce_cllearAll_Click(object sender, EventArgs e)
        {
            Image_MercurySetSource_result_show.Clear();
            Image_MercurySetSource_result_show.BackColor = Color.White;

        }

        private void Img_Wall_GetGeoMetry_butt_Click(object sender, EventArgs e)
        {
           int id;

            Img_Wall_geo_Result.BackColor = Color.Pink;
               
                string[] parm = new string[1];
                parm[0] = img_WallGeoMetry_input.Text;
                GuiBoxArray gui = new GuiBoxArray();
                gui.Add(WallGeo_X, WallGeo_Y, WallGeo_X_max, WallGeo_Y_max);
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_wallGeometry_get, parm, Img_Wall_geo_Result, gui);
                mProducer.CubeControlRequest(req,"Get WallGeometry");


                 gui = new GuiBoxArray();
                img_wallFullScrean_Result_show.BackColor = Color.Pink;
                gui.Add(Img_WallFullScrean_state_txtBox_show);
                 req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_wallConfig_state_get, null, img_wallFullScrean_Result_show, gui);
                mProducer.CubeControlRequest(req, "Get Geometry State");
           
        }

        private void Img_Wall_ClearALLGeoMetry_butt_Click(object sender, EventArgs e)
        {
            WallGeo_X.Clear();
            WallGeo_Y.Clear();
            WallGeo_X_max.Clear();
            WallGeo_Y_max.Clear();
            Img_Wall_geo_Result.Clear();
            Img_Wall_geo_Result.BackColor = Color.White;
            img_WallGeoMetry_Mode.Text = "";
        }

       

        

        private void Imag_Optical_dvi_Clearall_butt_Click(object sender, EventArgs e)
        {
            Imag_Optical_dvi_result_show.Clear();
            Imag_Optical_dvi_result_show.BackColor = Color.White;


        }

        private void img_getActive_source_get_butt_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            Img_activeSopurce_Result_Show.BackColor = Color.Pink;
            gui.Add(Img_activeSopurce_get_Show);
            Cube_command_reqObj req = new Cube_command_reqObj( cmd_requster.cubeControler  , 0, 0, commandType.cmd_get_Active_input, null, Img_activeSopurce_Result_Show, gui);
            mProducer.CubeControlRequest(req,"Get Active Source");
        }

        private void img_getActive_source_Clearall_Click(object sender, EventArgs e)
        {
            Img_activeSopurce_Result_Show.Clear();
            Img_activeSopurce_Result_Show.BackColor = Color.White;
            Img_activeSopurce_get_Show.Clear();
        }

        private void Img_Wall_FullScreanGet_butt_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            img_wallFullScrean_Result_show.BackColor = Color.Pink;
            gui.Add(Img_WallFullScrean_state_txtBox_show);
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_wallConfig_state_get, null, img_wallFullScrean_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Geometry State");
           

        }

        private void Img_Wall_FullScreanSet_butt_Click(object sender, EventArgs e)
        {
            int id;

            Img_Wall_geo_Result.BackColor = Color.HotPink;
            string []parms = new string[6];
            parms[0] =WallGeo_X.Text;
            parms[1] = WallGeo_Y.Text;
            parms[2] = WallGeo_X_max.Text;
            parms[3] = WallGeo_Y_max.Text;
            parms[4] = img_WallGeoMetry_input.Text;
            parms[5] = img_WallGeoMetry_Mode.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_wallGeometry_set, parms, Img_Wall_geo_Result, null);
            mProducer.CubeControlRequest(req, "Set Geometry");
            
            string state = "on";

            if (img_WallGeo_Enable_Off_radio.Checked) state = "off";
           
            img_wallFullScrean_Result_show.BackColor = Color.Pink;

            parms = new string[1];
            parms[0] = state;

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_wallConfig_state_set, parms, Img_Wall_geo_Result, null);

            mProducer.CubeControlRequest(req, "Set Geometry State");
        }

        private void Img_Wall_FullScrean_ClearAll_butt_Click(object sender, EventArgs e)
        {
            img_wallFullScrean_Result_show.Clear();
            img_wallFullScrean_Result_show.BackColor = Color.White;
            Img_WallFullScrean_state_txtBox_show.Clear();


        }

        private void img_Background_get_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox51, textBox52, textBox53);
            
            Img_background_result_show.BackColor = Color.Pink;
            
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_background_get, null, Img_background_result_show, gui);
            mProducer.CubeControlRequest(req, "Get Background");
        }

        private void img_Background_set_Click(object sender, EventArgs e)
        {
            
            
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(img_background_combo);
            Img_background_result_show.BackColor = Color.Pink;

            string[] parm = new string[4];
            parm[0] = img_background_combo.Text;
            parm[1] = textBox51.Text;
            parm[2] = textBox52.Text;
            parm[3] = textBox53.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_background_set, parm, Img_background_result_show, gui);

            mProducer.CubeControlRequest(req, "Set Background");
            SetColorPickerPanelBgCOlor(img_background_combo.Text, textBox51.Text, textBox52.Text, textBox53.Text);
           
        }

        private void img_Background_ClearALL_Click(object sender, EventArgs e)
        {
            Img_background_result_show.Clear();
            Img_background_result_show.BackColor = Color.White;
            textBox51.Clear();
            textBox52.Clear();
            textBox53.Clear();
        }

        private void img_Backgouond_color_picker_Click(object sender, EventArgs e)
        {
            colorDialog1.ShowDialog();
         

            textBox51.Text = colorDialog1.Color.R.ToString();
            textBox52.Text = colorDialog1.Color.G.ToString();
            textBox53.Text = colorDialog1.Color.B.ToString();

            Img_Color_picker_show_panel.BackColor = colorDialog1.Color;
        }

        private void Imag_Optical_dvi_get_butt_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            Imag_Optical_dvi_result_show.BackColor = Color.Pink;
            gui.Add(Image_optical_status_combo);
            string [] prm = new string[1];
            prm[0] = Imag_Optical_dvi_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_optical_dvi_get, prm, Imag_Optical_dvi_result_show, gui);
            mProducer.CubeControlRequest(req, "get Optical");

        }

        private void Imag_Optical_dvi_Set_butt_Click(object sender, EventArgs e)
        {
            
            Imag_Optical_dvi_result_show.BackColor = Color.Pink;
           
            string[] prm = new string[2];
            prm[0] = Imag_Optical_dvi_combo.Text;
            prm[1] = Image_optical_status_combo.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_optical_dvi_set, prm, Imag_Optical_dvi_result_show, null);
            mProducer.CubeControlRequest(req,"Set Optical");

        }

#endregion 

        

        private void pic_Contrast_Get_butt_Click(object sender, EventArgs e)
        {

            textBox48.BackColor = Color.Pink;
            
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_contrst_get, null, textBox48, null);
           mProducer.CubeControlRequest(req,"Get Contrast");
               
        }

        private void pic_Contrast_Apply_butt_Click(object sender, EventArgs e)
        {
           

            textBox48.BackColor = Color.Pink;

           
            string[] parm = new string[1];
            parm[0] = txtboxControst_show.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_contrst_set, parm, textBox48, null);
            mProducer.CubeControlRequest(req,"Set Contrast");
           
        }

        

        private void Pic_Contrast_Slider_Scroll(object sender, EventArgs e)
        {
            txtboxControst_show.Text = Pic_Contrast_Slider.Value.ToString();
        }

        private void Pic_Backlight_Slider_Scroll(object sender, EventArgs e)
        {
            txtboxBacklight_show.Text = Pic_Backlight_Slider.Value.ToString();
        }

        private void Pic_Brightness_Slider_Scroll(object sender, EventArgs e)
        {
            txtbox_Brightness_show.Text = Pic_Brightness_Slider.Value.ToString();
        }

        private void Pic_Red_gain_Slider_Scroll(object sender, EventArgs e)
        {
            txtbox_redGain_show.Text = Pic_Red_gain_Slider.Value.ToString();
        }

        private void Pic_Green_gain_Slider_Scroll(object sender, EventArgs e)
        {
            txtbox_GreenGain_show.Text = Pic_Green_gain_Slider.Value.ToString();
        }

        private void Pic_Blue_gain_Slider_Scroll(object sender, EventArgs e)
        {
            txtbox_BlueGain_show.Text = Pic_Blue_gain_Slider.Value.ToString();
        }

        private void fmw_GetMstar_fmw_version_clearALl_Click(object sender, EventArgs e)
        {

        }

        private void fmw_GetMstar_fmw_version_Click(object sender, EventArgs e)
        {

        }

        private void fmw_version_ClearAll_butt_Click(object sender, EventArgs e)
        {

        }

        private void fmw_version_Get_butt_Click(object sender, EventArgs e)
        {

        }

        private void pic_BackLlight_Get_butt_Click(object sender, EventArgs e)
        {
            textBox46.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_backlight_get, null, textBox46, null);
            mProducer.CubeControlRequest(req, "Get Backlight");

        }

        private void pic_BackLight_Apply_butt_Click(object sender, EventArgs e)
        {
            textBox46.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = txtboxBacklight_show.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_backlight_set, parm, textBox46, null);
            mProducer.CubeControlRequest(req, "Set Backlight");
        }

        private void pic_Brightness_Get_butt_Click(object sender, EventArgs e)
        {
            textBox45.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_brightness_get, null, textBox45, null);
            mProducer.CubeControlRequest(req, "Get Brightness");

        }

        private void pic_Brightness_Apply_butt_Click(object sender, EventArgs e)
        {
            textBox45.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = txtbox_Brightness_show.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_brightness_set, parm, textBox45, null);
            mProducer.CubeControlRequest(req, "Set Brightness");
        }

        private void pic_Red_Offset_Get_butt_Click(object sender, EventArgs e)
        {
            textBox186.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_red_offset_get, null, textBox186, null);
            mProducer.CubeControlRequest(req, "Get Red Offset");
        }

        private void pic_Green_Offset_Get_butt_Click(object sender, EventArgs e)
        {
            textBox214.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_green_offset_get, null, textBox214, null);
            mProducer.CubeControlRequest(req, "Get Green Offset");

        }

        private void pic_Blue_Offset_Get_butt_Click(object sender, EventArgs e)
        {
            textBox212.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_blue_offset_get, null, textBox212, null);
            mProducer.CubeControlRequest(req, "Get Green Offset");

        }


        
        
        private void pic_Reg_gain_Get_butt_Click(object sender, EventArgs e)
        {
            textBox49.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_red_gain_get, null, textBox49, null);
            mProducer.CubeControlRequest(req, "Get Red Gain");

        }

        private void pic_Red_gain_Apply_butt_Click(object sender, EventArgs e)
        {
            textBox49.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = txtbox_redGain_show.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_red_gain_set, parm, textBox49, null);
            mProducer.CubeControlRequest(req, "set Red Gain");

        }

        private void pic_Green_gain_Get_butt_Click(object sender, EventArgs e)
        {
            textBox47.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_green_gain_get, null, textBox47, null);
            mProducer.CubeControlRequest(req, "Get green Gain");

        }

        private void pic_Green_gain_Apply_butt_Click(object sender, EventArgs e)
        {
            textBox47.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = txtbox_GreenGain_show.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_green_gain_set, parm, textBox47, null);
            mProducer.CubeControlRequest(req, "set Green Gain");

        }

        private void pic_Blue_gain_Get_butt_Click(object sender, EventArgs e)
        {
            textBox34.BackColor = Color.Pink;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_blue_gain_get, null, textBox34, null);
            mProducer.CubeControlRequest(req, "Get Blue Gain");

        }

        private void pic_Blue_gain_Apply_butt_Click(object sender, EventArgs e)
        {
            textBox34.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = txtbox_BlueGain_show.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_blue_gain_set, parm, textBox34, null);
            mProducer.CubeControlRequest(req, "set Blue Gain");

        }

        private void Pic_BackLightBostSet_but_Click(object sender, EventArgs e)
        {
            PIc_BsckLightBoost_Result_show.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = pic_backLIghtBoost_conbo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_pic_boostLight_set, parm, PIc_BsckLightBoost_Result_show, null);
            mProducer.CubeControlRequest(req, "Set Back light boost");
        }

        private void Pic_BackLightBostClearAll_but_Click(object sender, EventArgs e)
        {
            PIc_BsckLightBoost_Result_show.Clear();
            PIc_BsckLightBoost_Result_show.BackColor = Color.White;
        }

        private void pic_Apply_ALL_butt_Click(object sender, EventArgs e)
        {
            pic_Contrast_Apply_butt_Click(null,null);
            pic_BackLight_Apply_butt_Click(null,null);
            pic_Brightness_Apply_butt_Click(null,null);
            pic_Red_gain_Apply_butt_Click(null,null);
            pic_Green_gain_Apply_butt_Click(null,null);
            pic_Blue_gain_Apply_butt_Click(null,null);
            Pic_BackLightBostSet_but_Click(null, null);
        }

        private void pic_Get_ALL_butt_Click(object sender, EventArgs e)
        {
            pic_Contrast_Get_butt_Click(null,null);
            pic_BackLlight_Get_butt_Click(null,null);
            pic_Brightness_Get_butt_Click(null,null);
            pic_Reg_gain_Get_butt_Click(null,null);
            pic_Green_gain_Get_butt_Click(null,null);
            pic_Blue_gain_Get_butt_Click(null, null);
        }

        private void Monitoring_GetFanSpeed_butt_Click(object sender, EventArgs e)
        {
            Mo_SetFanSpeed_Result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Mo_SetSpeed_txtbox);
            string[] parm = new string[1];
            parm[0] = "fan1";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_get_fan_speed, parm, Mo_SetFanSpeed_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Fan1 Speed");

            Mo_SetFanSpeed_Result_show.BackColor = Color.Pink;

            gui = new GuiBoxArray();
            gui.Add(textBox57);
            parm = new string[1];
            parm[0] = "fan2";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_get_fan_speed, parm, Mo_SetFanSpeed_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Fan2 Speed");

        }

        private void Monitoring_SetFanSpeed_butt_Click(object sender, EventArgs e)
        {
            Mo_SetFanSpeed_Result_show.BackColor = Color.Pink;

            if (Mo_fanSpeed_CheckBox_1.Checked)
            {
                string[] parm = new string[2];
                parm[0] = "fan1";
                parm[1] = Mo_SetSpeed_txtbox.Text;
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_get_fan_speed_set, parm, Mo_SetFanSpeed_Result_show, null);
                mProducer.CubeControlRequest(req, "Set Fan1 Speed");
            }

            if (Mo_fanSpeed_CheckBox_2.Checked)
            {
                string[] parm = new string[2];
                parm[0] = "fan2";
                parm[1] = textBox57.Text;
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_get_fan_speed_set, parm, Mo_SetFanSpeed_Result_show, null);
                mProducer.CubeControlRequest(req, "Set Fan2 Speed");
            }


        }

        private void Monitoring_GetTemp_butt_Click(object sender, EventArgs e)
        {
            Mo_GetTemprature_result_Show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Mo_GetTemprature_Temp_Show);
            string[] parm = new string[1];
            parm[0] = "mercury";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_temprature_get, parm, Mo_GetTemprature_result_Show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Temprature");

            gui = new GuiBoxArray();
            gui.Add(textBox58);
            parm = new string[1];
            parm[0] = "ops";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_temprature_get, parm, Mo_GetTemprature_result_Show, gui);
            mProducer.CubeControlRequest(req, "Get ops Temprature");


            gui = new GuiBoxArray();
            gui.Add(textBox60);
            parm = new string[1];
            parm[0] = "niro";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_temprature_get, parm, Mo_GetTemprature_result_Show, gui);
            mProducer.CubeControlRequest(req, "Get niro Temprature");

            gui = new GuiBoxArray();
            gui.Add(textBox59);
            parm = new string[1];
            parm[0] = "ambient";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_temprature_get, parm, Mo_GetTemprature_result_Show, gui);
            mProducer.CubeControlRequest(req, "Get ambient Temprature");


            gui = new GuiBoxArray();
            gui.Add(textBox61);
            parm = new string[1];
            parm[0] = "smps";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_temprature_get, parm, Mo_GetTemprature_result_Show, gui);
            mProducer.CubeControlRequest(req, "Get smps Temprature");
          



        }

        private void Monitoring_GetTemp_CleaAll_butt_Click(object sender, EventArgs e)
        {
            Mo_GetTemprature_result_Show.Clear();
            Mo_GetTemprature_result_Show.BackColor = Color.White;
            Mo_GetTemprature_Temp_Show.Clear();
            textBox58.Clear();
            textBox60.Clear();
            textBox59.Clear();
            textBox61.Clear();
        }

        private void fmw_version_Get_butt_Click_1(object sender, EventArgs e)
        {
            fmw_version_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(fmw_mercury_version);
            string[] parm = new string[1];
            parm[0] = "MrcSpiProj";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_module_version_get, parm, fmw_version_result_show, gui);
            mProducer.CubeControlRequest(req, "Get spi fmw version");


            gui = new GuiBoxArray();
            gui.Add(textBox54);
            parm = new string[1];
            parm[0] = "MrcFpga";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_module_version_get, parm, fmw_version_result_show, gui);
            mProducer.CubeControlRequest(req, "Get FPGA version");


            gui = new GuiBoxArray();
            gui.Add(textBox56);
            parm = new string[1];
            parm[0] = "MrcPs171";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_module_version_get, parm, fmw_version_result_show, gui);
            mProducer.CubeControlRequest(req, "Get MrcPs171 version");


            gui = new GuiBoxArray();
            gui.Add(textBox55);
            parm = new string[1];
            parm[0] = "MrcStdp";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_module_version_get, parm, fmw_version_result_show, gui);
            mProducer.CubeControlRequest(req, "Get MrcStdp version");
            

        }

        private void fmw_version_ClearAll_butt_Click_1(object sender, EventArgs e)
        {
            fmw_version_result_show.Clear();
            fmw_version_result_show.BackColor = Color.White;
            fmw_mercury_version.Clear();
            textBox54.Clear();
            textBox56.Clear();
            textBox55.Clear();
        }

        private void Net_GetMac_Click(object sender, EventArgs e)
        {
            Net_Mac_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Net_Mac_show);
            string[] parm = new string[1];
            parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mac_address_get, parm, Net_Mac_result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mac1 address");

            gui = new GuiBoxArray();
            gui.Add(textBox62);
            parm = new string[1];
            parm[0] = "eth1";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mac_address_get, parm, Net_Mac_result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mac2 address");

           


           


        }

        private void Net_SetMac_Click(object sender, EventArgs e)
        {
            Net_Mac_result_show.BackColor = Color.Pink;

            if (Net_if_Mac1_check.Checked)
            {
                string[] parm = new string[2];
                parm[0] = "eth0";
                parm[1] = Net_Mac_show.Text;
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mac_address_set, parm, Net_Mac_result_show, null);
                mProducer.CubeControlRequest(req, "Set mac1 Address");
            }

            if (Net_if_Mac2_check.Checked)
            {
                string[] parm = new string[2];
                parm[0] = "eth1";
                parm[1] = textBox62.Text;
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mac_address_set, parm, Net_Mac_result_show, null);
                mProducer.CubeControlRequest(req, "Set mac2 Address");
            }




           

        }

        private void Net_ClearALl_Click(object sender, EventArgs e)
        {
            Net_Mac_result_show.Clear();
            Net_Mac_result_show.BackColor = Color.White;
            Net_Mac_show.Clear();
            textBox62.Clear();
        }

        private void fmw_GetMstar_fmw_version_Click_1(object sender, EventArgs e)
        {
            fmw_msta_ver_Result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox50);

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fmw_mstar_version_get, null, fmw_msta_ver_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mstar fmw version");


            

        }

        private void fmw_GetMstar_fmw_version_clearALl_Click_1(object sender, EventArgs e)
        {
            fmw_msta_ver_Result_show.Clear();
            fmw_msta_ver_Result_show.BackColor = Color.White;
            textBox50.Clear();
        }


        private void Color_sesnor_set()
        {
            textBox22.BackColor = Color.Pink;

           
                string[] parm = new string[2];
                parm[0] = "97";
                parm[1] = "0";
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_set, parm, textBox22, null);
                mProducer.CubeControlRequest(req, string.Empty);

                parm = new string[2];
                parm[0] = "602";
                parm[1] = "3200";
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_set, parm, textBox22, null);
                mProducer.CubeControlRequest(req, string.Empty);

                parm = new string[2];
                parm[0] = "592";
                parm[1] = "0";
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_set, parm, textBox22, null);
                mProducer.CubeControlRequest(req, string.Empty);

                parm = new string[2];
                parm[0] = "592";
                parm[1] = "1";
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_set, parm, textBox22, null);
                mProducer.CubeControlRequest(req, string.Empty);

            

        }

        private void Color_sensor0_get()
        {

            textBox22.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox21);
            string[]  parm = new string[1];
            parm[0] = "594";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox22, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor1");


            gui = new GuiBoxArray();
            gui.Add(textBox20);
            parm = new string[1];
            parm[0] = "595";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox22, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor1");

            gui = new GuiBoxArray();
            gui.Add(textBox19);
            parm = new string[1];
            parm[0] = "596";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox22, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor1");

            gui = new GuiBoxArray();
            gui.Add(textBox15);
            parm = new string[1];
            parm[0] = "597";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox22, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor1");
            
            

        }

        private void Color_sensor1_get()
        {



            textBox17.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox16);
            string[] parm = new string[1];
            parm[0] = "598";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox17, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor2");


            gui = new GuiBoxArray();
            gui.Add(textBox14);
            parm = new string[1];
            parm[0] = "599";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox17, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor2");

            gui = new GuiBoxArray();
            gui.Add(textBox13);
            parm = new string[1];
            parm[0] = "600";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox17, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor2");

            gui = new GuiBoxArray();
            gui.Add(textBox12);
            parm = new string[1];
            parm[0] = "601";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_fpga_reg_get, parm, textBox17, gui);
            mProducer.CubeControlRequest(req, "Get Color Sensor2");
            

        }

        private void Col_Colsensor_0_get_butt_Click(object sender, EventArgs e)
        {
            Color_sesnor_set();
            Color_sensor0_get();
            Color_sensor1_get();

        }

        private void Col_Collor_0_Clear_Click(object sender, EventArgs e)
        {
            textBox21.Clear();
            textBox20.Clear();
            textBox19.Clear();
            textBox15.Clear();
            textBox16.Clear();
            textBox14.Clear();
            textBox13.Clear();
            textBox12.Clear();

            textBox21.BackColor = Color.White;
            textBox20.BackColor = Color.White;
            textBox19.BackColor = Color.White;
            textBox15.BackColor = Color.White;
            textBox16.BackColor = Color.White;
            textBox14.BackColor = Color.White;
            textBox13.BackColor = Color.White;
            textBox12.BackColor = Color.White;
        }

        private void DB_Bid_Mercury_get_Click(object sender, EventArgs e)
        {

            #region Get Mercury Bid
            DB_BiD_Mercury_Result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(DB_Bid_data_txtbx);
            string[] parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "det_brd_desc";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid det_brd_desc");

            gui = new GuiBoxArray();
            gui.Add(textBox2);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "dev_artcl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid dev_artcl_num");
           
            gui = new GuiBoxArray();
            gui.Add(textBox1);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "dev_prod_date";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid dev_prod_date");

            gui = new GuiBoxArray();
            gui.Add(textBox6);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "dev_serl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid dev_serl_num");

             gui = new GuiBoxArray();
            gui.Add(textBox5);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "id_ver_locn";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid id_ver_locn");


            gui = new GuiBoxArray();
            gui.Add(textBox4);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "id_ver_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid id_ver_num");

            gui = new GuiBoxArray();
            gui.Add(textBox3);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "mod_artcl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid mod_artcl_num");

           
             gui = new GuiBoxArray();
            gui.Add(textBox10);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "mod_prod_date";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid mod_prod_date");
            
             gui = new GuiBoxArray();
            gui.Add(textBox9);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "mod_prod_indx";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid mod_prod_indx");
           
             gui = new GuiBoxArray();
            gui.Add(textBox8);
            parm = new string[2];
            parm[0] = "mercury";
            parm[1] = "mod_serl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_BiD_Mercury_Result_show, gui);
            mProducer.CubeControlRequest(req, "Get Mercury Bid mod_serl_num");





            #endregion

        }

        private void DB_Bid_Mercury_Set_Click(object sender, EventArgs e)
        {
            #region Set Mercury Bid
            DB_BiD_Mercury_Result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = null;
            Cube_command_reqObj req = null;

            if (DB_Bid_data_txtbx.Text != "" && checkBox1.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(DB_Bid_data_txtbx);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "det_brd_desc";
                parm[2] = DB_Bid_data_txtbx.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid det_brd_desc");
            }

            if (textBox2.Text != "" && checkBox2.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox2);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "dev_artcl_num";
                parm[2] = textBox2.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid dev_artcl_num");
            }

            if (textBox1.Text != "" && checkBox4.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox1);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "dev_prod_date";
                parm[2] = textBox1.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid dev_prod_date");
            }

            if (textBox6.Text != "" && checkBox3.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox6);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "dev_serl_num";
                parm[2] = textBox6.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid dev_serl_num");
            }

            if (textBox5.Text != "" && checkBox6.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox5);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "id_ver_locn";
                parm[2] = textBox5.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid id_ver_locn");
            }

            if (textBox4.Text != "" && checkBox5.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox4);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "id_ver_num";
                parm[2] = textBox4.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid id_ver_num");
            }

            if (textBox3.Text != "" && checkBox8.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox3);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "mod_artcl_num";
                parm[2] = textBox3.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid mod_artcl_num");
            }


            if (textBox10.Text != "" && checkBox7.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox10);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "mod_prod_date";
                parm[2] = textBox10.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid mod_artcl_num");
            }

            if (textBox9.Text != "" && checkBox10.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox9);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "mod_prod_indx";
                parm[2] = textBox9.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid mod_prod_indx");
            }

            if (textBox8.Text != "" && checkBox9.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox8);
                parm = new string[3];
                parm[0] = "mercury";
                parm[1] = "mod_serl_num";
                parm[2] = textBox8.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set Mercury Bid mod_serl_num");
            }



            #endregion

        }

        private void DB_Bid_Mercury_ClearALl_Click(object sender, EventArgs e)
        {
            DB_BiD_Mercury_Result_show.Clear();
            DB_BiD_Mercury_Result_show.BackColor = Color.White;

            DB_Bid_data_txtbx.Clear();
            DB_Bid_data_txtbx.BackColor = Color.White;

            textBox1.Clear();
            textBox1.BackColor = Color.White;

            textBox2.Clear();
            textBox2.BackColor = Color.White;
            textBox6.Clear();
            textBox6.BackColor = Color.White;

            textBox5.Clear();
            textBox5.BackColor = Color.White;
            textBox4.Clear();
            textBox4.BackColor = Color.White;
            textBox3.Clear();
            textBox3.BackColor = Color.White;
            textBox10.Clear();
            textBox10.BackColor = Color.White;
            textBox9.Clear();
            textBox9.BackColor = Color.White;
            textBox8.Clear();
            textBox8.BackColor = Color.White;
        }

        private void DB_Niro_Bid_Get_Click(object sender, EventArgs e)
        {
            #region Get Niro Bid
            DB_Niro_Bid_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox33);
            string[] parm = new string[2];
            parm[0] = "niro";
            parm[1] = "det_brd_desc";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid det_brd_desc");

            gui = new GuiBoxArray();
            gui.Add(textBox32);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "dev_artcl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid dev_artcl_num");

            gui = new GuiBoxArray();
            gui.Add(textBox31);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "dev_prod_date";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid dev_prod_date");

            gui = new GuiBoxArray();
            gui.Add(textBox30);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "dev_serl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid dev_serl_num");

            gui = new GuiBoxArray();
            gui.Add(textBox29);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "id_ver_locn";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid id_ver_locn");


            gui = new GuiBoxArray();
            gui.Add(textBox28);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "id_ver_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid id_ver_num");

            gui = new GuiBoxArray();
            gui.Add(textBox27);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "mod_artcl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid mod_artcl_num");


            gui = new GuiBoxArray();
            gui.Add(textBox26);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "mod_prod_date";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid mod_prod_date");

            gui = new GuiBoxArray();
            gui.Add(textBox25);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "mod_prod_indx";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid mod_prod_indx");

            gui = new GuiBoxArray();
            gui.Add(textBox24);
            parm = new string[2];
            parm[0] = "niro";
            parm[1] = "mod_serl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Niro_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get niro Bid mod_serl_num");





            #endregion


        }

        private void DB_Niro_Bid_Set_Click(object sender, EventArgs e)
        {
            #region Set Niro Bid
            DB_Niro_Bid_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = null;
            Cube_command_reqObj req = null;

            if (textBox33.Text != "" && checkBox20.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox33);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "det_brd_desc";
                parm[2] = textBox33.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid det_brd_desc");
            }

            if (textBox32.Text != "" && checkBox19.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox32);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "dev_artcl_num";
                parm[2] = textBox32.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid dev_artcl_num");
            }

            if (textBox31.Text != "" && checkBox18.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox31);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "dev_prod_date";
                parm[2] = textBox31.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid dev_prod_date");
            }

            if (textBox30.Text != "" && checkBox17.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox30);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "dev_serl_num";
                parm[2] = textBox30.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid dev_serl_num");
            }

            if (textBox29.Text != "" && checkBox16.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox29);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "id_ver_locn";
                parm[2] = textBox29.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid id_ver_locn");
            }

            if (textBox28.Text != "" && checkBox15.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox28);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "id_ver_num";
                parm[2] = textBox28.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid id_ver_num");
            }

            if (textBox27.Text != "" && checkBox14.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox27);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "mod_artcl_num";
                parm[2] = textBox27.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Niro_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid mod_artcl_num");
            }


            if (textBox26.Text != "" && checkBox13.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox26);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "mod_prod_date";
                parm[2] = textBox26.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid mod_artcl_num");
            }

            if (textBox25.Text != "" && checkBox12.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox25);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "mod_prod_indx";
                parm[2] = textBox25.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid mod_prod_indx");
            }

            if (textBox24.Text != "" && checkBox11.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox24);
                parm = new string[3];
                parm[0] = "niro";
                parm[1] = "mod_serl_num";
                parm[2] = textBox24.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_BiD_Mercury_Result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro Bid mod_serl_num");
            }



            #endregion

        }

        private void DB_Niro_Bid_ClearAll_Click(object sender, EventArgs e)
        {
            DB_Niro_Bid_result_show.Clear();
            DB_Niro_Bid_result_show.BackColor = Color.White;

            textBox33.Clear();
            textBox33.BackColor = Color.White;

            textBox32.Clear();
            textBox32.BackColor = Color.White;


            textBox31.Clear();
            textBox31.BackColor = Color.White;

            textBox30.Clear();
            textBox30.BackColor = Color.White;
            textBox29.Clear();
            textBox29.BackColor = Color.White;

            textBox28.Clear();
            textBox28.BackColor = Color.White;
            textBox27.Clear();
            textBox27.BackColor = Color.White;
            textBox26.Clear();
            textBox26.BackColor = Color.White;
            textBox25.Clear();
            textBox25.BackColor = Color.White;
            textBox24.Clear();
            textBox24.BackColor = Color.White;
        }

        private void DB_Display_Bid_Get_Click(object sender, EventArgs e)
        {
            #region Get Display Bid

            DB_Display_Bid_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox44);
            string[] parm = new string[2];
            parm[0] = "display";
            parm[1] = "det_brd_desc";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid det_brd_desc");

            gui = new GuiBoxArray();
            gui.Add(textBox43);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "dev_artcl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid dev_artcl_num");

            gui = new GuiBoxArray();
            gui.Add(textBox42);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "dev_prod_date";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid dev_prod_date");

            gui = new GuiBoxArray();
            gui.Add(textBox41);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "dev_serl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid dev_serl_num");

            gui = new GuiBoxArray();
            gui.Add(textBox40);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "id_ver_locn";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid id_ver_locn");


            gui = new GuiBoxArray();
            gui.Add(textBox39);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "id_ver_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid id_ver_num");

            gui = new GuiBoxArray();
            gui.Add(textBox38);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "mod_artcl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid mod_artcl_num");


            gui = new GuiBoxArray();
            gui.Add(textBox37);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "mod_prod_date";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid mod_prod_date");

            gui = new GuiBoxArray();
            gui.Add(textBox36);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "mod_prod_indx";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid mod_prod_indx");

            gui = new GuiBoxArray();
            gui.Add(textBox35);
            parm = new string[2];
            parm[0] = "display";
            parm[1] = "mod_serl_num";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_get, parm, DB_Display_Bid_result_show, gui);
            mProducer.CubeControlRequest(req, "Get display Bid mod_serl_num");





            #endregion

        }

        private void DB_Display_Bid_Set_Click(object sender, EventArgs e)
        {
            #region Set Display Bid

            DB_Display_Bid_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = null;
            Cube_command_reqObj req = null;

            if (textBox44.Text != "" && checkBox30.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox44);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "det_brd_desc";
                parm[2] = textBox44.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid det_brd_desc");
            }

            if (textBox43.Text != "" && checkBox29.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox43);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "dev_artcl_num";
                parm[2] = textBox43.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set niro display dev_artcl_num");
            }

            if (textBox42.Text != "" && checkBox28.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox42);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "dev_prod_date";
                parm[2] = textBox42.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid dev_prod_date");
            }

            if (textBox41.Text != "" && checkBox27.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox41);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "dev_serl_num";
                parm[2] = textBox41.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid dev_serl_num");
            }

            if (textBox40.Text != "" && checkBox26.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox40);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "id_ver_locn";
                parm[2] = textBox40.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid id_ver_locn");
            }

            if (textBox39.Text != "" && checkBox25.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox39);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "id_ver_num";
                parm[2] = textBox39.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid id_ver_num");
            }

            if (textBox38.Text != "" && checkBox24.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox38);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "mod_artcl_num";
                parm[2] = textBox38.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid mod_artcl_num");
            }


            if (textBox37.Text != "" && checkBox23.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox37);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "mod_prod_date";
                parm[2] = textBox37.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid mod_artcl_num");
            }

            if (textBox36.Text != "" && checkBox22.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox36);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "mod_prod_indx";
                parm[2] = textBox36.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid mod_prod_indx");
            }

            if (textBox35.Text != "" && checkBox21.Checked)
            {
                gui = new GuiBoxArray();
                gui.Add(textBox35);
                parm = new string[3];
                parm[0] = "display";
                parm[1] = "mod_serl_num";
                parm[2] = textBox35.Text;
                req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_bid_set, parm, DB_Display_Bid_result_show, gui);
                mProducer.CubeControlRequest(req, "Set display Bid mod_serl_num");
            }



            #endregion

        }

        private void DB_Display_Bid_ClearAll_Click(object sender, EventArgs e)
        {
            DB_Display_Bid_result_show.Clear();
            DB_Display_Bid_result_show.BackColor = Color.White;

            textBox44.Clear();
            textBox44.BackColor = Color.White;

            textBox43.Clear();
            textBox43.BackColor = Color.White;


            textBox42.Clear();
            textBox42.BackColor = Color.White;

            textBox41.Clear();
            textBox41.BackColor = Color.White;
            textBox40.Clear();
            textBox40.BackColor = Color.White;

            textBox39.Clear();
            textBox39.BackColor = Color.White;
            textBox38.Clear();
            textBox38.BackColor = Color.White;
            textBox37.Clear();
            textBox37.BackColor = Color.White;
            textBox36.Clear();
            textBox36.BackColor = Color.White;
            textBox35.Clear();
            textBox35.BackColor = Color.White;
        }

        private void DB_saveAll_Click(object sender, EventArgs e)
        {
            DB_saveAll_result_show.BackColor = Color.Pink;
            
            Cube_command_reqObj req = null;
            req = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 0, 0, commandType.cmd_dataBase_saveAll, null, DB_saveAll_result_show, null);
                mProducer.CubeControlRequest(req, "Save All");
            
        }

        private void Img_get_genLockStatus_get_butt_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            Img_get_genLockStatus_result_show.BackColor = Color.Pink;
            gui.Add(Img_get_genLockStatus_status);
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_genlock_status_get, null, Img_get_genLockStatus_result_show, gui);
            mProducer.CubeControlRequest(req, "Get GenLock Status");
        }

        private void Img_get_genLockStatus_ClearAll_butt_Click(object sender, EventArgs e)
        {
            Img_get_genLockStatus_result_show.Clear();
            Img_get_genLockStatus_result_show.BackColor = Color.White;
            Img_get_genLockStatus_status.Clear();
        }

        private void Img_GetInputTiming_but_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            Img_getInputTiming_result_show.BackColor = Color.Pink;
            gui.Add(textBox66, textBox68, textBox70, textBox69);
            string[] prm = new string[1];
            prm[0] = img_channeling_timeing_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_input_timing_get, prm, Img_getInputTiming_result_show, gui);
            mProducer.CubeControlRequest(req, "Get Channel Timings");

        }

        private void Img_GetInputTiming_ClearAll_but_Click(object sender, EventArgs e)
        {
            Img_getInputTiming_result_show.Clear();
            Img_getInputTiming_result_show.BackColor = Color.White;
            textBox66.Clear();
            textBox68.Clear();
            textBox70.Clear();
            textBox69.Clear();
        }

        private void Img_GetALL_Click(object sender, EventArgs e)
        {
            Img_GetMercurySourceSelected_butt_Click(null, null);
            Imag_Optical_dvi_get_butt_Click(null, null);
            Img_GetInputTiming_but_Click(null, null);
            Img_get_genLockStatus_get_butt_Click(null, null);
            Img_Wall_GetGeoMetry_butt_Click(null, null);
            img_Background_get_Click(null, null);
            Img_Wall_FullScreanGet_butt_Click(null, null);
            img_getActive_source_get_butt_Click(null, null);
            Img_Get_erros_but_Click(null, null);
            Img_Get_VideoBypass_but_Click(null, null);
            Img_GetInputTiming_but_Click(null, null);
        }

        private void Img_Get_erros_but_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            img_Errors_get_results_show.BackColor = Color.Pink;
            gui.Add(textBox65, textBox73);
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_errors_get, null, img_Errors_get_results_show, gui);
            mProducer.CubeControlRequest(req, "get videoBypass wallCfg error");
            
        }

        private void Img_SetMstar_video_but_Click(object sender, EventArgs e)
        {



            GuiBoxArray gui = null;
            
            Img_ShowMstar_video_result.BackColor = Color.Pink;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_mstar_video_set, null, Img_ShowMstar_video_result, gui);

            mProducer.CubeControlRequest(req, "Set Mercury Video");
        }

        private void img_DDC_timing_combo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (img_DDC_timing_combo.Text == "ddc_custom")
            {
                Image_Set_edid_filePath_show.Enabled = true;
                Img_edid_Browse_butt.Enabled = true;
            }
            else
            {
                Image_Set_edid_filePath_show.Enabled = false;
                Img_edid_Browse_butt.Enabled = false;
            }

        }
        private void Addedid_options_to_combo(string input_p)
        {


            switch (input_p)
            {
                case "dvi1":
                case "dvi2":
                    this.img_DDC_timing_combo.Items.AddRange(new object[] {
            "ddc_1920_1080_25000",
            "ddc_1920_1080_25500",
            "ddc_1920_1080_29970",
            "ddc_1920_1080_30500",
            "ddc_1920_1080_50000",
            "ddc_1920_1080_50500",
            "ddc_1920_1080_59940",
            "ddc_1920_1080_60500",
            "ddc_1920_2160_25000",
            "ddc_1920_2160_25500",
            "ddc_1920_2160_29970",
            "ddc_1920_2160_30500",
            "ddc_3840_1080_25000",
            "ddc_3840_1080_25500",
            "ddc_3840_1080_29970",
            "ddc_3840_1080_30500",
            "ddc_custom"});
                    img_DDC_timing_combo.Text = "ddc_1920_1080_25000";
                    break;
                case "hdmi":
                case "dp":
                case "ops":
                    this.img_DDC_timing_combo.Items.AddRange(new object[] {
            "ddc_1920_1080_25000",
            "ddc_1920_1080_25500",
            "ddc_1920_1080_29970",
            "ddc_1920_1080_30500",
            "ddc_1920_1080_50000",
            "ddc_1920_1080_50500",
            "ddc_1920_1080_59940",
            "ddc_1920_1080_60500",
            "ddc_1920_2160_25000",
            "ddc_1920_2160_25500",
            "ddc_1920_2160_29970",
            "ddc_1920_2160_30500",
            "ddc_1920_2160_50000",
            "ddc_1920_2160_50500",
            "ddc_1920_2160_59940",
            "ddc_1920_2160_60500",
            "ddc_1920_3240_25000",
            "ddc_1920_3240_25500",
            "ddc_1920_3240_29970",
            "ddc_1920_3240_30500",
            "ddc_3840_1080_25000",
            "ddc_3840_1080_25500",
            "ddc_3840_1080_29970",
            "ddc_3840_1080_30500",
            "ddc_3840_1080_50000",
            "ddc_3840_1080_50500",
            "ddc_3840_1080_59940",
            "ddc_3840_1080_60500",
            "ddc_3840_2160_25000",
            "ddc_3840_2160_25500",
            "ddc_3840_2160_29970",
            "ddc_3840_2160_30500",
                    "ddc_custom"});
                    img_DDC_timing_combo.Text = "ddc_1920_1080_25000";
                    break;
                default:
                    this.img_DDC_timing_combo.Items.AddRange(new object[] {
            "ddc_1920_1080_25000",
            "ddc_1920_1080_25500",
            "ddc_1920_1080_29970",
            "ddc_1920_1080_30500",
            "ddc_1920_1080_50000",
            "ddc_1920_1080_50500",
            "ddc_1920_1080_59940",
            "ddc_1920_1080_60500",
            "ddc_1920_2160_25000",
            "ddc_1920_2160_25500",
            "ddc_1920_2160_29970",
            "ddc_1920_2160_30500",
            "ddc_3840_1080_25000",
            "ddc_3840_1080_25500",
            "ddc_3840_1080_29970",
            "ddc_3840_1080_30500",
             "ddc_custom"});
                    img_DDC_timing_combo.Text = "ddc_1920_1080_25000";
                    break;


            }


        }

        private void Image_Set_edid_input_combo_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < img_DDC_timing_combo.Items.Count; i++)
                img_DDC_timing_combo.Items.RemoveAt(i);

            img_DDC_timing_combo.Items.Clear();


            Addedid_options_to_combo(Image_Set_edid_input_combo.Text);

        }

        private void Img_edid_Browse_butt_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            if (openFileDialog1.CheckFileExists)
            {
                Image_Set_edid_filePath_show.Text = openFileDialog1.FileName;

            }
            else
                MessageBox.Show(openFileDialog1.FileName + " File Does not exists");
           
        }

        private void SetEdid(string Filepath)
        {

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Image_MercurySourceList_combo);
            Image_Set_edid_result_show.BackColor = Color.Pink;

            string[] parm = new string[3];
            parm[0] = Image_Set_edid_input_combo.Text;
            parm[1] = Filepath;
            parm[2] = Image_Set_edid_filePath_show.Text; //Only For Custom


            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_edid_set, parm, Image_Set_edid_result_show, gui);

            mProducer.CubeControlRequest(req, "Set Edid");
        }

        private void VerifyEdit(string Filepath)
        {

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Image_MercurySourceList_combo);
            Image_Set_edid_result_show.BackColor = Color.Pink;

            string[] parm = new string[3];
            parm[0] = Image_Set_edid_input_combo.Text;
            parm[1] = Filepath;
            parm[2] = Image_Set_edid_filePath_show.Text; //Only For Custom


            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_edid_verify, parm, Image_Set_edid_result_show, gui);

            mProducer.CubeControlRequest(req, "Verify Edid");

        }

        private void Image_Set_edid_butt_set_Click(object sender, EventArgs e)
        {
            string filePath = string.Empty;
            string Intput = Image_Set_edid_input_combo.Text + "/";

            if (Intput == "ops/") Intput = "hdmi/";
            if (Intput == "dvi1/" || Intput == "dvi2/") Intput = "dvi/";

            filePath = "/opt/fmw/edid_files/OVD_KVD_XX21/" + Intput + img_DDC_timing_combo.Text + ".bin";

            if (Image_Set_edid_Set_Radio_butt.Checked == true)
            {
                if (img_DDC_timing_combo.Text == "ddc_custom")
                    SetEdid(string.Empty);
                else
                    SetEdid(filePath);

            }

            if (Image_Set_edid_Verify_Radio_butt.Checked == true)
            {
                if (img_DDC_timing_combo.Text == "ddc_custom")
                    VerifyEdit(string.Empty);
                else
                    VerifyEdit(filePath);
                

            }
        }

        private void Img_Get_VideoBypass_but_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = new GuiBoxArray();
            Imag_GetSetVideoByPass_result_show.BackColor = Color.Pink;
            gui.Add(Img_VideoByPass_combo);
            string[] parm = new string[1];
            parm[0] = Img_VideoBypass_input_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_video_byPass_get, parm, Imag_GetSetVideoByPass_result_show, gui);
            mProducer.CubeControlRequest(req, "get videoBypass");



        }

        private void Img_Set_VideoBypass_but_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = null;
            
            Imag_GetSetVideoByPass_result_show.BackColor = Color.Pink;

            string[] parm = new string[2];
            parm[0] = Img_VideoBypass_input_combo.Text;
            parm[1] = Img_VideoByPass_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_video_byPass_set, parm, Imag_GetSetVideoByPass_result_show, gui);
            mProducer.CubeControlRequest(req, "Set VideoByPass");
            
        }

        private void Image_Set_edid_butt_Clearall_Click(object sender, EventArgs e)
        {
            Image_Set_edid_result_show.Clear();
            Image_Set_edid_result_show.BackColor = Color.White;
        }

        private void Img_SetMstar_video_ClearAllbut_Click(object sender, EventArgs e)
        {
            Img_ShowMstar_video_result.Clear();
            Img_ShowMstar_video_result.BackColor = Color.White;
        }

        private void Img_Get_erros_ClearALL_but_Click(object sender, EventArgs e)
        {
            img_Errors_get_results_show.Clear();
            img_Errors_get_results_show.BackColor = Color.White;
            textBox65.Clear();
            textBox73.Clear();
        }

        private void Img_GetSet_VideoBypass_ClearAllbut_Click(object sender, EventArgs e)
        {
            Imag_GetSetVideoByPass_result_show.Clear();
            Imag_GetSetVideoByPass_result_show.BackColor = Color.White;
        }

        private void MO_GetRunTimes_Click(object sender, EventArgs e)
        {
            textBox67.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox74, textBox167,textBox23);
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_runtimes_get, null, textBox67, gui);
            mProducer.CubeControlRequest(req, "Get Runtimes");

        }

        private void mo_Getruntime_clear_Click(object sender, EventArgs e)
        {

        }

        private void Mo_Get_stat_Click(object sender, EventArgs e)
        {
            textBox84.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox85, textBox83, textBox82);
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_meminfo_get, null, textBox84, gui);
            mProducer.CubeControlRequest(req, "Get Stats");


            gui = new GuiBoxArray();
            gui.Add(textBox81, textBox79, textBox80);
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_loadinfo_get, null, textBox84, gui);
            mProducer.CubeControlRequest(req, "Get Stats");



        }

        private void Mo_Get_stat_clearAll_Click(object sender, EventArgs e)
        {

        }

        private void Mo_Get_All_Click(object sender, EventArgs e)
        {
            MO_GetRunTimes_Click(null, null);
            Mo_Get_stat_Click(null, null);
            Monitoring_GetFanSpeed_butt_Click(null, null);
            Monitoring_GetTemp_butt_Click(null, null);

        }

        private void FMW_Get_all_Click(object sender, EventArgs e)
        {
            fmw_version_Get_butt_Click_1(null, null);
            fmw_GetMstar_fmw_version_Click_1(null, null);
        }

        private void DB_Get_all_Click(object sender, EventArgs e)
        {
            DB_Bid_Mercury_get_Click(null, null);
            DB_Niro_Bid_Get_Click(null, null);
            DB_Display_Bid_Get_Click(null, null);

        }

        private void Gen_GetAutoSave_but_Click(object sender, EventArgs e)
        {
            textBox86.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(GetSetAutoSave_combo);
            
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_AutoSave_state_get, null, textBox86, gui);
            mProducer.CubeControlRequest(req, "Get Auto save");
        }

        private void Gen_SetAutoSave_but_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = null;
            textBox86.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = GetSetAutoSave_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_AutoSave_state_set, parm, textBox86, gui);
            mProducer.CubeControlRequest(req, "Set Auto save");
        }


        #region Ops Tab Commands
        private void ops_GetOpState_but_Click(object sender, EventArgs e)
        {
            ops_GetSetOperation_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(ops_SeoGet_OPeration);

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_ops_operationt_get, null, ops_GetSetOperation_result_show, gui);
            mProducer.CubeControlRequest(req, "Get Ops State");

            Ops_Control_Panel_refresh_Click(null, null);

        }

        private void ops_SetOpState_but_Click(object sender, EventArgs e)
        {
            GuiBoxArray gui = null;
            ops_GetSetOperation_result_show.BackColor = Color.Pink;
            string[] parm = new string[1];
            parm[0] = ops_SeoGet_OPeration.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_ops_operationt_set, parm, ops_GetSetOperation_result_show, gui);
            mProducer.CubeControlRequest(req, "Set ops State");

           // Ops_Control_Panel_refresh_Click(null, null); 

           

        }

        private void ops_tOpState_but_clearAll_Click(object sender, EventArgs e)
        {
            ops_GetSetOperation_result_show.Clear();
            ops_GetSetOperation_result_show.BackColor = Color.White;
        }

        private void Ops_Control_Panel_refresh_Click(object sender, EventArgs e)
        {

            GuiBoxArray gui = null;


            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_ops_power_state_get, null, textBox7, gui);
            mProducer.CubeControlRequest(req, "Get Ops Power");

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_ops_fan_state_get, null, textBox7, gui);
            mProducer.CubeControlRequest(req, "Get Ops Fan");

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_ops_plug_state_get, null, textBox7, gui);
            mProducer.CubeControlRequest(req, "Get Ops Fan");
           
        }
        #endregion

        private void Net_Get_IpAddress_but_Click(object sender, EventArgs e)
        {
            Net_getSetNicIF_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox71, textBox72);
            string[] parm = new string[1];
            parm[0] = Net_NicIf_eth_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_net_networkIf_get, parm, Net_getSetNicIF_result_show, gui);
            mProducer.CubeControlRequest(req, "Get net Network Info");

        }

        private void Net_Set_IpAddress_but_Click(object sender, EventArgs e)
        {
            Net_getSetNicIF_result_show.BackColor = Color.Pink;

            
                string[] parm = new string[4];
                parm[0] = Net_NicIf_eth_combo.Text;
                parm[1] = Net_GetSetNetIf_Mode_combo.Text;
                parm[2] = textBox71.Text;
                parm[3] = textBox72.Text;

                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_net_networkIf_set, parm, Net_getSetNicIF_result_show, null);
                mProducer.CubeControlRequest(req, "Set Net Info");
           
            
            
            
           
        }

        private void Net_IpAddress__clearALLbut_Click(object sender, EventArgs e)
        {

        }

        private void Net_Get_Netinfo_Click(object sender, EventArgs e)
        {

            textBox77.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox78, textBox76, textBox75);
            string[] parm = new string[1];
            parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_net_NetInfo_get, parm, textBox77, gui);
            mProducer.CubeControlRequest(req, "Get net  Info eth0");


            gui = new GuiBoxArray();
            gui.Add(textBox138, textBox139, textBox134);
            parm = new string[1];
            parm[0] = "eth1";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_net_NetInfo_get, parm, textBox143, gui);
            mProducer.CubeControlRequest(req, "Get net  Info eth1");
            
            
        }

        private void Net_Get_Netinfo_clearAll_Click(object sender, EventArgs e)
        {

            textBox77.Clear();
            textBox77.BackColor = Color.White;
            textBox78.Clear();
            textBox75.Clear();
            textBox76.Clear();

            textBox143.Clear();
            textBox143.BackColor = Color.White;
            textBox138.Clear();
            textBox139.Clear();
            textBox134.Clear();
        }


        private void Net_GetSetNetIf_Mode_combo_SelectedIndexChanged(object sender, EventArgs e)
        {

            if (Net_GetSetNetIf_Mode_combo.Text == "static")
            {
                textBox71.Enabled = true;
                textBox72.Enabled = true;

            }
            else
            {
                textBox71.Enabled = false;
                textBox72.Enabled = false;
            }

        }

        #region Color Managament

        private void CS_RawCount_get_butt_Click(object sender, EventArgs e)
        {

            CS_raw_get_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            
            gui.Add(textBox63, //sensor 0 status
                    textBox20, //sensor 1 status
                    textBox12, // Sensor 0 red
                    textBox13, // Sensor 0 green
                    textBox11,  // Sensor 0 blue
                    textBox15, // Sensor 0 white
                    textBox18, // Sensor 1 red
                    textBox19, // Sensor 1 green
                    textBox17, // Sensor 1 blue
                    textBox16);// Sensor 1 white
            //string[] parm = new string[1];
            //parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_raw_count_get, null, CS_raw_get_result_show, gui);
            mProducer.CubeControlRequest(req, "Get CS Raw Count");
        }

        private void CS_RawCount_get_ClearALlbutt_Click(object sender, EventArgs e)
        {
            CS_raw_get_result_show.Clear();
            CS_raw_get_result_show.BackColor = Color.White;
            textBox63.Clear();
            textBox20.Clear();
            textBox12.Clear();
            textBox13.Clear();
            textBox11.Clear();
            textBox15.Clear();
            textBox18.Clear();
            textBox19.Clear();
            textBox17.Clear();
            textBox16.Clear();
        }


        private void CS_Raw_CIS_get_butt_Click(object sender, EventArgs e)
        {
            CS_raw_CIS_get_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox96, //sensor 0 status
                    textBox91, //sensor 1 status
                    textBox94, // Sensor 0 red
                    textBox95, // Sensor 0 green
                    textBox93,  // Sensor 0 blue
                    textBox92, // Sensor 0 white
                    textBox89, // Sensor 1 red
                    textBox90, // Sensor 1 green
                    textBox88, // Sensor 1 blue
                    textBox21);// Sensor 1 white
            //string[] parm = new string[1];
            //parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_raw_mes_cis_get, null, CS_raw_CIS_get_result_show, gui);
            mProducer.CubeControlRequest(req, "Get CS CIS  Mes");

           
        }

        private void CS_Raw_CIS__ClearAll_butt_Click(object sender, EventArgs e)
        {
            CS_raw_CIS_get_result_show.Clear();
            CS_raw_CIS_get_result_show.BackColor = Color.White;
            textBox96.Clear();
            textBox91.Clear();
            textBox94.Clear();
            textBox95.Clear();
            textBox93.Clear();
            textBox92.Clear();
            textBox89.Clear();
            textBox90.Clear();
            textBox88.Clear();
            textBox21.Clear();
        }

        private void CS_BackLight_mes_get_butt_Click(object sender, EventArgs e)
        {



            CS_BackLIght__result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox106, //sensor 0 status
                    textBox101, //sensor 1 status
                    textBox104, // Sensor 0 red
                    textBox105, // Sensor 0 green
                    textBox103,  // Sensor 0 blue
                    textBox102, // Sensor 0 white
                    textBox99, // Sensor 1 red
                    textBox100, // Sensor 1 green
                    textBox98, // Sensor 1 blue
                    textBox97);// Sensor 1 white
            //string[] parm = new string[1];
            //parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_backlight_mes_get, null, CS_BackLIght__result_show, gui);
            mProducer.CubeControlRequest(req, "Get CS Black Light  Mes");
        }

        private void CS_BackLight_mes_n_updateget_butt_Click(object sender, EventArgs e)
        {
            CS_BackLIght__result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox106, //sensor 0 status
                    textBox101, //sensor 1 status
                    textBox104, // Sensor 0 red
                    textBox105, // Sensor 0 green
                    textBox103,  // Sensor 0 blue
                    textBox102, // Sensor 0 white
                    textBox99, // Sensor 1 red
                    textBox100, // Sensor 1 green
                    textBox98, // Sensor 1 blue
                    textBox97);// Sensor 1 white
            //string[] parm = new string[1];
            //parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_backlight_mes_update_get, null, CS_BackLIght__result_show, gui);
            mProducer.CubeControlRequest(req, "Get CS Update Black Light  Mes");
           
        }

        private void CS_BackLight_mes_ClearAll_butt_Click(object sender, EventArgs e)
        {
            CS_BackLIght__result_show.Clear();
            CS_BackLIght__result_show.BackColor = Color.White;
            textBox106.Clear();
            textBox101.Clear();
            textBox104.Clear();
            textBox105.Clear();
            textBox103.Clear();
            textBox102.Clear();
            textBox99.Clear();
            textBox100.Clear();
            textBox98.Clear();
            textBox97.Clear();
        }

        

        private void CS_Get_cs_params_butt_Click(object sender, EventArgs e)
        {
            CS_params_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Cs_param_Gain_combo,
                   Cs_param_Prescaler_combo,
                   Cs_param_Period_combo,
                   Cs_param_Pulse_combo);
            //string[] parm = new string[1];
            //parm[0] = "eth0";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_params_get, null, CS_params_result_show, gui);
            mProducer.CubeControlRequest(req, "get cs params");
        }

        

        private void CS_Set_cs_params_butt_Click(object sender, EventArgs e)
        {
            CS_params_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[4];
            parm[0] = Cs_param_Gain_combo.Text;
            parm[1] = Cs_param_Prescaler_combo.Text;
            parm[2] = Cs_param_Period_combo.Text;
            parm[3] = Cs_param_Pulse_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_params_set, parm, CS_params_result_show, gui);
            mProducer.CubeControlRequest(req, "set cs params");
        }

       

        private void CS_Get_cs_params_ClearAll_butt_Click(object sender, EventArgs e)
        {
            CS_params_result_show.Clear();
            CS_params_result_show.BackColor = Color.White;
        }

      

        private void CS_Mes_Loop_time_Set_butt_Click(object sender, EventArgs e)
        {
            CS_Loop_time_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[2];
            parm[0] = CS_Mes_loop_time_status_combo.Text;
            parm[1] = textBox22.Text;
            

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_loop_time_set, parm, CS_Loop_time_result_show, gui);
            mProducer.CubeControlRequest(req, "set cs loop interval");



        }

        private void CS_Mes_Loop_time_ClearALl_butt_Click(object sender, EventArgs e)
        {

        }

        private void cs_backLight_Get_butt_Click(object sender, EventArgs e)
        {
            textBox14.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(Cs_param_Gain_combo,
                   Cs_param_Prescaler_combo,
                   Cs_param_Period_combo,
                   Cs_param_Pulse_combo);

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_backLight_get, null, textBox14, gui);
            mProducer.CubeControlRequest(req, "get Back light");
            
        }

        private void cs_backLight_set_butt_Click(object sender, EventArgs e)
        {
            textBox14.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[1];
            parm[0] = cs_back_light_show.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_backLight_set, parm, textBox14, gui);
            mProducer.CubeControlRequest(req, "Set Back light");

        }

        private void CS_BackLight_slider_Scroll(object sender, EventArgs e)
        {
            cs_back_light_show.Text = CS_BackLight_slider.Value.ToString();
        }

      

        private void Cs_Get_usr_targetControl_params_Click(object sender, EventArgs e)
        {
            Cs_Get_usr_targetControl_params_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_user_target_control_params_get, null, Cs_Get_usr_targetControl_params_result_show, gui);
            mProducer.CubeControlRequest(req, "get User Target Control");
        }

        private void Cs_Set_usr_targetControl_params_Click(object sender, EventArgs e)
        {
            Cs_Get_usr_targetControl_params_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[4];
            parm[0] = textBox158.Text;
            parm[1] = textBox157.Text;
            parm[2] = cs_UTP_GaamaFacrot_Combo.Text;
            parm[3] = textBox152.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_user_target_control_params_set, parm, Cs_Get_usr_targetControl_params_result_show, gui);
            mProducer.CubeControlRequest(req, "Set User Target Control");

        }

        private void Cs_Get_usr_targetControl_params_clearAll_Click(object sender, EventArgs e)
        {
            Cs_Get_usr_targetControl_params_result_show.Clear();
            Cs_Get_usr_targetControl_params_result_show.BackColor = Color.White;
        }

        private void CS_GetCBM_Mode_butt_Click(object sender, EventArgs e)
        {
            textBox159.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray(); ;
            gui.Add(cs_cbm_mode_Combo);
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_cbm_mode_get, parm, textBox159, gui);
            mProducer.CubeControlRequest(req, "Get CBM mode");

        }

        private void CS_SetCBM_Mode_butt_Click(object sender, EventArgs e)
        {
            textBox159.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[1];
            parm[0] = cs_cbm_mode_Combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_cbm_mode_set, parm, textBox159, gui);
            mProducer.CubeControlRequest(req, "Set CBM mode");

        }

        private void CS_GetCBM_Mode_ClearALLbutt_Click(object sender, EventArgs e)
        {
            textBox159.Clear();
            textBox159.BackColor = Color.White;
        }

        

        private void CS_get_white_banalce_butt_Click(object sender, EventArgs e)
        {
            Gte_white_balance_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox155, textBox154, textBox153);
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_white_banance_get, parm, Gte_white_balance_result_show, gui);
            mProducer.CubeControlRequest(req, "Get White Balance");

        }

        private void CS_Set_white_banalce_butt_Click(object sender, EventArgs e)
        {
            Gte_white_balance_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[3];
            parm[0] = textBox155.Text;
            parm[1] = textBox154.Text;
            parm[2] = textBox153.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_white_banance_set, parm, Gte_white_balance_result_show, gui);
            mProducer.CubeControlRequest(req, "Set White Balance");


        }

        private void CS_get_white_banalce_butt_clearall_Click(object sender, EventArgs e)
        {
            Gte_white_balance_result_show.Clear();
            Gte_white_balance_result_show.BackColor = Color.White;
            textBox155.Clear();
            textBox154.Clear();
            textBox153.Clear();

        }

        private void Cs_Black_level_Get_butt_Click(object sender, EventArgs e)
        {
            textBox171.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray(); ;
            gui.Add(textBox170);
            
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_black_level_get, parm, textBox171, gui);
            mProducer.CubeControlRequest(req, "Get Black Level");

            gui = new GuiBoxArray();
            gui.Add(textBox168);

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_white_level_get, parm, textBox171, gui);
            mProducer.CubeControlRequest(req, "Get White Level");


        }

        private void Cs_Black_level_Set_butt_Click(object sender, EventArgs e)
        {

            textBox171.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[1];
            parm[0] = textBox170.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_black_level_set, parm, textBox171, gui);
            mProducer.CubeControlRequest(req, "Set Black Level");


             parm = new string[1];
            parm[0] = textBox168.Text;

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_white_level_set, parm, textBox171, gui);
            mProducer.CubeControlRequest(req, "Set White Level");
        }

        private void Cs_Black_level_ClearAll_butt_Click(object sender, EventArgs e)
        {
            textBox171.Clear();
            textBox171.BackColor = Color.White;
            textBox170.Clear();
            textBox168.Clear();
        }

        private void CS_sensX_Get_CBM_params_butt_Click(object sender, EventArgs e)
        {
            textBox156.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray(); ;
            gui.Add(textBox166,
                    textBox165,
                    textBox164,
                    textBox162,
                    textBox161,
                    textBox160,
                    textBox163);

            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_cbm_mode_params_get, parm, textBox156, gui);
            mProducer.CubeControlRequest(req, "get_cbm_native_params");

        }

        private void CS_sensX_Set_CBM_params_butt_Click(object sender, EventArgs e)
        {
            textBox156.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = new string[7];
            parm[0] = textBox166.Text;
            parm[1] = textBox165.Text;
            parm[2] = textBox164.Text;
            parm[3] = textBox162.Text;
            parm[4] = textBox161.Text;
            parm[5] = textBox160.Text;
            parm[6] = textBox163.Text;


            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_cbm_mode_params_set, parm, textBox156, gui);
            mProducer.CubeControlRequest(req, "Set CBM NAtive Params ");
        }

        private void CS_sensX_Get_CBM_params_ClearAllbutt_Click(object sender, EventArgs e)
        {
            textBox156.Clear();
            textBox156.BackColor = Color.White;
            textBox166.Clear();
            textBox165.Clear();
            textBox164.Clear();
            textBox162.Clear();
            textBox161.Clear();
            textBox160.Clear();
            textBox163.Clear();
        }

        private void Cs_Get_eror_info_get_Click(object sender, EventArgs e)
        {
            textBox181.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray(); ;
            gui.Add(textBox180,
                    textBox179,
                    textBox178,
                    textBox176,
                    textBox175);

            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_gobal_error_info_get, parm, textBox181, gui);
            mProducer.CubeControlRequest(req, "get_status_err_info");

        }

        

        private void Cs_Get_eror_info_ClearALl_Click(object sender, EventArgs e)
        {
            textBox181.Clear();
            textBox181.BackColor = Color.White;
        }

        private void CS_MinMax_brightness_get_Click(object sender, EventArgs e)
        {
            textBox173.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray(); ;
            gui.Add(textBox172, textBox169);

            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_max_min_brightness_get, parm, textBox173, gui);
            mProducer.CubeControlRequest(req, "max_min_brightness");

        }

        private void CS_MinMax_brightness_get_clearAll_Click(object sender, EventArgs e)
        {
            textBox171.Clear();
            textBox171.BackColor = Color.White;
        }

        private void cs_tiggher_white_correction_butt_Click(object sender, EventArgs e)
        {
            cs_Tigger_white_correction_Result_show.BackColor = Color.Pink;

            GuiBoxArray gui = null;

            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_tigger_white_correction, parm, cs_Tigger_white_correction_Result_show, gui);
            mProducer.CubeControlRequest(req, "trigger_white_correction");

        }

        private void cs_tiggher_white_correction__clearbutt_Click(object sender, EventArgs e)
        {
            cs_Tigger_white_correction_Result_show.Clear();
            cs_Tigger_white_correction_Result_show.BackColor = Color.White;
        }
       

        private void CS_Get_Field_calibration_butt_Click(object sender, EventArgs e)
        {
            CS_Get_Reset_Field_Calibration_Result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox107, //RED X
                    textBox109, //RED Y
                    textBox110, // RED Z
                    textBox113, //GREEN X
                    textBox112,  //GREEN Y
                    textBox111, // GREEN Z
                    textBox116, //BLUE X
                    textBox115, //BLUE Y
                    textBox114 // BLUE Z
                             );

            string[] parm = new string [1];
            

            Cube_command_reqObj req = null;
            if (CS_Get_reset_Field_calibration_Radio_CS0.Checked)
                parm[0] = "cs0";
            else
                parm[0] = "cs1";

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_field_calib_get, parm, CS_Get_Reset_Field_Calibration_Result_show, gui);
            mProducer.CubeControlRequest(req, "get_field_calibration");
            

        }

        private void CS_Reset_Field_calibration_butt_Click(object sender, EventArgs e)
        {

            DialogResult result = MessageBox.Show("Do you really wish to reset field calibration", "CAUTION !!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result != System.Windows.Forms.DialogResult.Yes) return;

            CS_Get_Reset_Field_Calibration_Result_show.BackColor = Color.Pink;

            GuiBoxArray gui = null;

            string[] parm = new string[1];

            if (CS_Get_reset_Field_calibration_Radio_CS0.Checked)
                parm[0] = "cs0";
            else
                parm[0] = "cs1";


            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_field_calib_reset, parm, CS_Get_Reset_Field_Calibration_Result_show, gui);
            mProducer.CubeControlRequest(req, "Reset_field_calibration");


        }

        private void CS_Field_calibration_ClearALLbutt_Click(object sender, EventArgs e)
        {
            CS_Get_Reset_Field_Calibration_Result_show.Clear();
            CS_Get_Reset_Field_Calibration_Result_show.BackColor = Color.White;
            textBox107.Clear();
            textBox109.Clear();
            textBox110.Clear();
            textBox113.Clear();
            textBox112.Clear();
            textBox111.Clear();
            textBox116.Clear();
            textBox115.Clear();
            textBox114.Clear();

        }

        private void CS_Get_Factory_calibration_butt_Click(object sender, EventArgs e)
        {
            CS_Get_Reset_Factory_Calibration_Result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox125, //RED X
                    textBox124, //RED Y
                    textBox123, // RED Z
                    textBox122, //GREEN X
                    textBox121,  //GREEN Y
                    textBox120, // GREEN Z
                    textBox119, //BLUE X
                    textBox118, //BLUE Y
                    textBox117 // BLUE Z
                             );

            string[] parm = new string[1];


            Cube_command_reqObj req = null;
            if (CS_Get_reset_Factory_calibration_Radio_CS0.Checked)
                parm[0] = "cs0";
            else
                parm[0] = "cs1";

            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_factory_calib_get, parm, CS_Get_Reset_Factory_Calibration_Result_show, gui);
            mProducer.CubeControlRequest(req, "get_factory_calibration");

        }

        private void CS_Factory_calibration_ClearALLbutt_Click(object sender, EventArgs e)
        {
            CS_Get_Reset_Factory_Calibration_Result_show.Clear();
            CS_Get_Reset_Factory_Calibration_Result_show.BackColor = Color.White;
            textBox107.Clear();
            textBox109.Clear();
            textBox110.Clear();
            textBox113.Clear();
            textBox112.Clear();
            textBox111.Clear();
            textBox116.Clear();
            textBox115.Clear();
            textBox114.Clear();
        }

      

        private void CS_ext_ref_data_get_butt_Click(object sender, EventArgs e)
        {
            CS_Ext_ref_data_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox133, //Date
                    textBox132, //"proddata"
                    textBox131, //"processVer"
                    textBox137, //RED X
                    textBox136, //RED Y
                    textBox135, // RED Z
                    textBox130, //GREEN X
                    textBox129,//GREEN Y
                    textBox128,//GREEN Z
                    textBox127,  //BLUE X 
                    textBox126,  //BLUE Y
                    textBox108 // BLUE Z
                    );

            string[] parm = null;


            if (CS_ext_ref_data_Field_Radio__butt.Checked)
            {
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_ext_field_ref_data_get, parm, CS_Ext_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "get_external_field_cs_ref_data");
            }
            else
            {
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_ext_factory_ref_data_get, parm, CS_Ext_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "get_external_factory_cs_ref_data");
            }


            


        }

        private void CS_ext_ref_data_Set_butt_Click(object sender, EventArgs e)
        {
            CS_Ext_ref_data_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = null;
            string[] parm = new string[13];
            parm[1] = textBox133.Text;
            parm[2] = textBox132.Text;
            parm[3] = textBox131.Text;
            parm[4] = textBox137.Text;
            parm[5] = textBox136.Text;
            parm[6] = textBox135.Text;
            parm[7] = textBox130.Text;
            parm[8] = textBox129.Text;
            parm[9] = textBox128.Text;
            parm[10] = textBox127.Text;
            parm[11] = textBox126.Text;
            parm[12] = textBox108.Text;

            if (CS_ext_ref_data_Field_Radio__butt.Checked)
            {
                parm[0] = "set_external_field_cs_ref_data";
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_ext_field_ref_data_set, parm, CS_Ext_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "set_external_field_cs_ref_data");
            }
            else
            {
                parm[0] = "set_external_factory_cs_ref_data";
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_ext_factory_ref_data_set, parm, CS_Ext_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "set_external_factory_cs_ref_data");
            }


        }
        private void CS_ext_ref_data_ClearAll_butt_Click(object sender, EventArgs e)
        {
            CS_Ext_ref_data_result_show.BackColor = Color.White;
            CS_Ext_ref_data_result_show.Clear();
            textBox133.Clear();
            textBox132.Clear();
            textBox131.Clear();
            textBox137.Clear();
            textBox136.Clear();
            textBox135.Clear();
            textBox130.Clear();
            textBox129.Clear();
            textBox128.Clear();
            textBox127.Clear();
            textBox126.Clear();
            textBox108.Clear();
        }
        
        

        private void CS_int_ref_data_get_butt_Click(object sender, EventArgs e)
        {
            CS_int_ref_data_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox148, //RED 0
                    textBox147, //green 0
                    textBox146, // blue 0
                    textBox142, //red 1
                    textBox141,  //GREEN 1
                    textBox140 // blue 1
                    );

            string[] parm = null;


            if (CS_int_ref_data_Field_Radio__butt.Checked)
            {
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_int_field_ref_data_get, parm, CS_int_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "get_internal_field_cs_ref_data");
            }
            else
            {
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_int_factory_ref_data_get, parm, CS_int_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "get_internal_factory_cs_ref_data");
            }


        }

        private void CS_int_ref_data_Set_butt_Click(object sender, EventArgs e)
        {
            CS_int_ref_data_result_show.BackColor = Color.Pink;

            GuiBoxArray gui = null;

            string[] parm = null;


            if (CS_int_ref_data_Field_Radio__butt.Checked)
            {
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_int_field_ref_data_set, parm, CS_int_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "set_internal_field_cs_ref_data");
            }
            else
            {
                Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_int_factory_ref_data_set, parm, CS_int_ref_data_result_show, gui);
                mProducer.CubeControlRequest(req, "set_internal_factory_cs_ref_data");
            }

        }
        private void button4_Click(object sender, EventArgs e)
        {
            CS_int_ref_data_result_show.Clear();
            CS_int_ref_data_result_show.BackColor = Color.White;
        }

        private void CS_Calibration_XYZ_Mes_Butt_Click(object sender, EventArgs e)
        {
            CS_Calib_XYZ_Mes_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();

            gui.Add(textBox149, textBox145, textBox144);

           
            string[] parm = new string[1];
            parm[0] = CS_Clib_XYZ_Device_type_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_Calibrated_XYZ_get, parm, CS_Calib_XYZ_Mes_result_show, gui);
            mProducer.CubeControlRequest(req, "Get CS Raw Count");

        }

        private void CS_Calibration_XYZ_Mes_ClearALLButt_Click(object sender, EventArgs e)
        {

        }

        #endregion

        private void Img_Get_Pattern_butt_Click(object sender, EventArgs e)
        {
            Img_getSet_pattern_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();

            gui.Add(img_PatternType_combo);


            string[] parm = null;
            
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_pattern_type_get, parm, Img_getSet_pattern_result_show, gui);
            mProducer.CubeControlRequest(req, "Get Pattren");

        }

        private void Img_Set_Pattern_butt_Click(object sender, EventArgs e)
        {
            Img_getSet_pattern_result_show.BackColor = Color.Pink;
            GuiBoxArray gui = null;


            string[] parm = new string[1];
            parm[0] = img_PatternType_combo.Text;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_img_pattern_type_set, parm, Img_getSet_pattern_result_show, gui);
            mProducer.CubeControlRequest(req, "Set Pattren");

        }

        private void Img_Get_Pattern_ClearALlbutt_Click(object sender, EventArgs e)
        {
            Img_getSet_pattern_result_show.Clear();
            Img_getSet_pattern_result_show.BackColor = Color.White;

        }

        private void CS_Barco_gama_set_butt_Click(object sender, EventArgs e)
        {
            textBox182.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 0, 0, commandType.cmd_cs_barco_gama_set, parm, textBox182, gui);
            mProducer.CubeControlRequest(req, "upload_barco_gamma");

        }

        private void CS_Barco_gama_set_ClearALLbutt_Click(object sender, EventArgs e)
        {
            textBox182.Clear();
            textBox182.BackColor = Color.White;

        }

        private void groupBox75_Enter(object sender, EventArgs e)
        {

        }

        private void CS_Gaama_status_get_Click(object sender, EventArgs e)
        {
            textBox64.BackColor = Color.Pink;

            GuiBoxArray gui = new GuiBoxArray(); ;
            gui.Add(textBox87);
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_cs_gaam_upload_status_get, parm, textBox64, gui);
            mProducer.CubeControlRequest(req, "get_status_err_info");
        }

        private void CS_GaamA_Status_ClearALL_Click(object sender, EventArgs e)
        {

        }

        private void Monitoring_GetFanTicks_butt_Click(object sender, EventArgs e)
        {
            textBox184.BackColor = Color.Pink;
            GuiBoxArray gui = new GuiBoxArray();
            gui.Add(textBox185);
            string[] parm = new string[1];
            parm[0] = "fan1";
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_get_fan_ticks, parm, textBox184, gui);
            mProducer.CubeControlRequest(req, "Get Fan1 Ticks");

            Mo_SetFanSpeed_Result_show.BackColor = Color.Pink;

            gui = new GuiBoxArray();
            gui.Add(textBox183);
            parm = new string[1];
            parm[0] = "fan2";
            req = new Cube_command_reqObj(cmd_requster.cubeControler, 0, 0, commandType.cmd_mo_get_fan_ticks, parm, textBox184, gui);
            mProducer.CubeControlRequest(req, "Get Fan2 Ticks");
        }

        private void Mo_getLogFile_butt_Click(object sender, EventArgs e)
        {
            MO_LogMessages_richBox.Clear();
            textBox174.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 0, 0, commandType.cmd_mo_get_log_msg_count_internal, parm, textBox174, gui);
            mProducer.CubeControlRequest(req, "Get Log Msg count");
        }

        private void MO_Clear_Lo_Msgs_Click(object sender, EventArgs e)
        {
            MO_LogMessages_richBox.Clear();
        }

        private void mo_Get_diagnostics_butt_Click(object sender, EventArgs e)
        {
            MO_LogMessages_richBox.Clear();
            textBox177.BackColor = Color.Pink;
            GuiBoxArray gui = null;
            string[] parm = null;
            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 0, 0, commandType.cmd_mo_tigger_Diagnostics, parm, textBox177, gui);
            mProducer.CubeControlRequest(req, "Trigger and Get Diagnosis");
        }

        private void mo_Get_diagnostics_butt_clear_Click(object sender, EventArgs e)
        {

        }

        private void Artificial_delay_Click(object sender, EventArgs e)
        {


            string[] parm = new string[1];
            parm[0] = textBox187.Text;

            Cube_command_reqObj req = new Cube_command_reqObj(cmd_requster.cubeControler_rpc_mode, 0, 0, commandType.cmd_artificial_sleep_set, parm, null, null);
            mProducer.CubeControlRequest(req, "Trigger and Get Diagnosis");

        }

        

       
        


    }
}




